Jump to content

Why Won't The Javascript Run When Uploaded To Server?


Recommended Posts

Posted

Hello again.

I'm using a pretty sleak jQuery script that does a pretty cool transition to every page. For a more smooth navigation.

Works great when I try it "locally", but once I upload it to my webserver it just stops working. Why is this?

<script type="text/javascript" src="jQuery/jquery-1.4.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    $("body").css("display", "none");

    $("body").fadeIn(2000);

    $("a.transition").click(function(event){
        event.preventDefault();
        linkLocation = this.href;
        $("body").fadeOut(1000, redirectPage);
    });

    function redirectPage() {
        window.location = linkLocation;
    }
});
</script>

Posted

I would the say the same, make sure the library exists in the directory where your Javascript lives and that the path to the Library in the script is correct.

Posted

As the others have said check the JavaScript error console and see if it is complaining about anything (don't have a JavaScript console then install chrome or Firefox with the firebug plugin).

If the jQuery files and directory aren't there then upload them. If they are there but the web server can't serve them then check the owners and permissions of the jQuery files and directory and make sure that the web server can access it.

Posted (edited)

EDIT: Fixed it, as mentioned the path to jQuery was set incorrectly. Working great now.

Thanks guys! :D

Edited by gEEEk

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...