I am executing following code but i am getting error: "Objected Expected" I checked the code but didnt find any problem.
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
$(document).ready(function(){
$("#clickme").click(function(){
$("#body1").load("http://www.w3schools.com");
});
});
</script>
</head>
<body>
<div id="header">
<a href="#" id="#clickme">Click me</a>
hello
</div>
<div id="body1">
mid
</div>
<div id="footer">
hi
</div>
</body>
</html>
asked May 20, 2013 at 8:46
Aquarius24
1,8746 gold badges34 silver badges64 bronze badges
2 Answers 2
Your id should be
<a href="#" id="clickme">Click me</a>
There was a # in your id.
** EDIT **
Your other problem is that you can't load a page on another domain into your site. You'll have to use an iframe for that.
answered May 20, 2013 at 8:48
Niklas
13.2k24 gold badges83 silver badges124 bronze badges
Sign up to request clarification or add additional context in comments.
1 Comment
Aquarius24
still its not loading. I am using IE8 :(
Try removing the hash sign from the id of clickme
<a href="#" id="clickme">Click me</a>
answered May 20, 2013 at 8:49
Kevin Bowersox
94.7k19 gold badges164 silver badges198 bronze badges
Comments
default