Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Apr 2012
    Posts
    29
    Thanks
    5
    Thanked 4 Times in 4 Posts

    Right code but won't work when I upload to FTP

    Hey everyone, I believe I have the right code, and it works fine on localhost, but when I upload it to FTP, it doesn't work live.

    the website is : www.theurbanape.com

    Here is the code: (ps. it is linked to jquery-1.4.1.min.js)

    Code:
    <strong></strong><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <html>
    <head>
    <link rel="stylesheet" href="style.css" type="text/css" />
    <title>Urban Ape</title>
    
    <script type="text/javascript" src="jquery-1.4.1.min.js"></script>
    
    <script type="text/javascript">
        $(document).ready(function() {
                $("body").css("display", "none");
                $("body").fadeIn(3000);
    			$("a.transition").click(function(event){
            event.preventDefault();
            linkLocation = this.href;
            $("body").fadeOut(1000, redirectPage);
        });
     
     
        function redirectPage() {
            window.location = linkLocation;
        }
        });
    </script>
    </head>
    
    <body>
    <div class="center"><a href="intropage.html" class="transition"><img src="Images/apecity.jpg" alt="test image" title="Enter The Jungle" height="400" width="400" /></a></div>
    </body>
    
    
    </html>

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,650
    Thanks
    80
    Thanked 4,636 Times in 4,598 Posts
    And what, pray tell, does "doesn't work" mean?

    The page loads, so something works.

    And your HTML is illegal. You aren't allowed to have anything before the <!DOCTYPE ...> and you have <strong></strong>
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,650
    Thanks
    80
    Thanked 4,636 Times in 4,598 Posts
    Okay...I see it.

    Look at the error console.

    It says $ is undefined. Which means jQuery isn't defined.

    Maybe you forgot to upload jQuery to your site (it certainly isn't there). But it would be a better idea to use jQuery from some known repository (e.g., Google), anyway.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    Paulbart (06-20-2012)

  • #4
    Regular Coder
    Join Date
    Apr 2012
    Posts
    165
    Thanks
    1
    Thanked 39 Times in 39 Posts
    What exactly isn't working about it? Is the original image supposed to fade in when you first get to the page? Then you want it to fade out and the new page will fade in once you click the image? You do realize that you've set the fade in speed for the original page to 3 seconds and the fade out (onclick) to 1 second, right? Have you tried adjusting those?

    Don't know if that's the issue or if you've got some other problems with your code. Or maybe I've completely misunderstood the question

    EDIT: Old Pendant is correct. Your link to the jquery file returns a 404 (not found) error.
    Last edited by EpicWebDesign; 06-19-2012 at 11:27 PM.

  • #5
    New Coder
    Join Date
    Apr 2012
    Posts
    29
    Thanks
    5
    Thanked 4 Times in 4 Posts
    I apologise for the ambiguous post. It should load in (3 seconds) and then fade out once clicked in one second?

    Which it does fine in localhost, but not FTP.

    Thanks for the replies

    IT'S ALL FIXED! THANKS FOR THE HELP! WAS AN UPLOADING ERROR
    Last edited by Paulbart; 06-20-2012 at 12:52 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •