...

View Full Version : Right code but won't work when I upload to FTP



Paulbart
06-19-2012, 09:59 PM
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)


<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>

Old Pedant
06-19-2012, 10:14 PM
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>

Old Pedant
06-19-2012, 10:17 PM
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.

EpicWebDesign
06-19-2012, 10:25 PM
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.

Paulbart
06-19-2012, 11:49 PM
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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum