954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

()load function in jquery not working

hi there guys :) im currently working on a project with jquery...
the thing is.. i need to change the contents of a div named "sub2" with the contents of "pets.html"... i've read some tutorials and i thought the best way to do this is through the use of jquery... so here's my code...

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
function contentDisp()
{
$.ajax({
url : "pets.html",
success : function (data) {
$("#sub2").html(data);
}
});
} </script>


my image which is supposed to be clicked contains this

<a id="pets" onClick="contentDisp()"><img src="images/pets.png" id="pets"/></a>


the code is working ., but when i transfer my codes to netbeans with Tomcat running the code didnt work ...

is there anyone here who knows what's wrong or what should i do with my code? thanks in advance :)

xiiopao
Newbie Poster
18 posts since Apr 2011
Reputation Points: 10
Solved Threads: 0
 

xiiopao,

It's more likely something to do with your Tomcat configuration than the javascript.

Maybe the server is not set up to respond to the .html extension.

Airshow

Airshow
WiFi Lounge Lizard
Moderator
2,683 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: