1,105,334 Community Members

()load function in jquery not working

Member Avatar
xiiopao
Newbie Poster
20 posts since Apr 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
Airshow
WiFi Lounge Lizard
2,798 posts since Apr 2009
Reputation Points: 333 [?]
Q&As Helped to Solve: 393 [?]
Skill Endorsements: 11 [?]
Team Colleague
 
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

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: