Trendkiller
Trendkiller

Reputation: 177

jQuery and all .js files not working locally, only externally

I've got a strange problem. I'm coding a website and inlcuding jQuery and some plugins, that are stored in 'js' folder. When I try to open it through a browser jQuery, plugins and all my custom scripts aren't working. Maybe it's somehing with my code, but don't think so. Of course when I inlude jQuery externally (Google API's) it works, but got some plugins and scripts which aren't hosted elsewhere. Here's 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]-->

Upvotes: 4

Views: 5446

Answers (4)

George
George

Reputation: 2213

I know this thread is old, but I have't found the answer to this very annoying problem so I am adding my solution.

If your physical folder path includes an underscore, it will fail. So, if you dropped your website to lets say C:\MyRoot\MyFolder_2\WebSite1\ then it won't work. however, if you remove the underscore and it becomes C:\MyRoot\MyFolder2\WebSite1\ it will suddenly work and jQuery will suddenly be loaded.

Upvotes: 0

Trendkiller
Trendkiller

Reputation: 177

Ok I have solved my problem. It's my IDE fault - Aptana Studio 3. This bug occured because I didn't upload hidden .project file, while I copied it through default file browser (Ubuntu's Nautilus). When I used built-in AS3 ftp manager it also copied .project file, and now it works.

Upvotes: 0

Neelesh
Neelesh

Reputation: 496

Try to do

"./js/..."

I think it will work as with external jquery.

Thanks

Upvotes: 0

Daniel Liuzzi
Daniel Liuzzi

Reputation: 17147

By locally do you mean a local web server (i.e. http://localhost:12345/) or the file system (i.e. file:///C:/Users/John/Desktop/hello.htm)? If it's the latter, then it's probably the security settings. Some browsers block scripts from the file system by default.

Upvotes: 1

Related Questions