Load Another Webpage Content Using Simple Jquery
Guys here we are gonna see how we can load another webpage content using jquery, very simple to use.
Code:
1. HTML Page
Here is the code of “test.html” file
<head>
<title>Content Showing Script</title>
<script type=”text/javascript” src=”jquery-1.2.6.js”></script>
<script type=”text/javascript”>
function content()
{
$.ajax({
url : “getpage.php”,
success : function (data) {
$(”#content”).html(data);
}
});
}
</script>
</head>
<body>
Get The Content<br><input type=”button” value=”Get Data” onClick=”
content();”><br><textarea id=”content” rows=”10″ cols=”50″></textarea>
2. Edit the GETPAGE.PHP page and add this script
<?php
echo “This is a test Page<br>”;
echo “From Mistonline.in <br>”;
</body>
</html>
Hope this tutorial helped you a lot.Thanks
Related posts:
- Jquery Basics, How to use jquery?
- Simple PHP mail Script
- Send Email to Multiple Persons using php
- Simple Visitor Counter Using php
- Adding a draggable div along with the cursor using simple javascript
- Change webpage background color using javascript
- Simple Ajax with PHP click tracker
