58
rated 0 times
[
60]
[
2]
/ answers: 1 / hits: 23342
/ 11 Years ago, tue, january 7, 2014, 12:00:00
My site consists of two pages. I'm trying to load Page 2 into a div on page one, then display page 2 onclick. I'm trying to use the following code which isn't working. I'm a newbie so my apologies if this is just dumb question.
<!DOCTYPE html>
<html>
<head>
<script src=http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js>
</script>
<script>
$(document).ready(function(){
$(button).click(function(){
$.ajax({url:myPage2.html,success:function(result){
$(#div1).html(result);
}});
});
});
</script>
</head>
<body>
<div id=div1><h2>Let jQuery AJAX Change This Text</h2></div>
<button>Get External Content</button>
</body>
</html>
More From » jquery