JQuery and all .js files do not work locally, only from the outside

I have a strange problem. I am coding a website and adding jQuery and some plugins that are stored in the js folder. When I try to open it through jQuery browser, plugins and all my own scripts do not work. Perhaps this is due to my code, but I don't think so. Of course, when I enable jQuery from the outside (Google API), it works, but it has plugins and scripts that are not located elsewhere. Here is my 'head' tag.

<title>TOMTRANS - International Transport</title> <!-- CSS --> <link rel="stylesheet" type="text/css" href="css/style.css" media="screen" /> <!-- S3Slider CSS --> <link rel="stylesheet" type="text/css" href="css/s3slider.css" media="screen" /> <!-- jQuery --> <script type="text/javascript" src="js/jquery-1.6.2.min.js"></script> <!-- jQuery Effects --> <script type="text/javascript" src="js/functions.js"></script> <!-- S3Slider --> <script type="text/javascript" src="js/s3Slider.js"></script> <!-- S3Slider Init --> <script type="text/javascript"> $(function() { $('#s3slider').s3Slider({ timeOut : 3000, }); }); </script> <!-- HTML5 Shiv --> <!--[if lt IE 9]> <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> 
+4
source share
4 answers

Locally, do you mean the local web server (i.e. http: // localhost: 12345 / ) or the file system (e.g. file: /// C: /Users/John/Desktop/hello.htm)? If this is the last, then it is probably a security setting. Some browsers block scripts from the file system by default.

+1
source

Try to do

 "./js/..." 

I think it will work as with external jquery.

thanks

0
source

Ok, I solved my problem. This is my IDE error - Aptana Studio 3. This error occurred because I did not download the hidden .project file, but I copied it through the default file browser (Ubuntu Nautilus). When I used the AS3 ftp built-in manager, it also copied the .project file, and now it works.

0
source

I know that this thread is outdated, but I did not find the answer to this very unpleasant problem, so I add my solution.

If your path to the physical folder contains an underscore, it will fail. So, if you drop your website to say C:\MyRoot\MyFolder_2\WebSite1\ , then this will not work. however, if you remove the underscore and becomes C:\MyRoot\MyFolder2\WebSite1\ , it will suddenly start working and jQuery will suddenly load.

0
source

Source: https://habr.com/ru/post/1369096/


All Articles