We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,389 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

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

2
Contributors
1
Reply
23 Hours
Discussion Span
2 Years Ago
Last Updated
2
Views
xiiopao
Newbie Poster
20 posts since Apr 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 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,782 posts since Apr 2009
Reputation Points: 370
Solved Threads: 388
Skill Endorsements: 9

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0809 seconds using 2.69MB