How To Get Contents from Other Websites Using jQuery?

Step 1: Create index.html and add the code below: (Change YOURDOMAIN.com)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
<script>
$(document).ready(function(){
$("#allh2").load("http://www.YOURDOMAIN.com/loader.php div",{want2Read:'http://en.wikipedia.org/wiki/Steve_jobs'},function(){
//Write your additional jQuery script below. For instance:
$("div").attr("class","mw-content-ltr");
});
});
</script>
 </head> <body>
<h1>Wow, this stuff is need</h1>
<p class="optionalcontent">All headers from <a href="http://www.want2read.com/">want2read</a>, I learned this from <a href="http://www.sitegrind.nl/">Sitegrind</a></p>
<div id="allh2"> </div>

</body> </html>

Step 2 : Create loader.php

<?php
extract($_POST);
$str = file_get_contents($want2Read);
echo $str;
?>
Jhovenell Marasigan is a web designer and developer specializing in WordPress, Adobe Photoshop and Adobe Dreamweaver. He spends a lot of his time thinking about and studying the latest treands about the internet, information philosophy, web design and development.
Recent Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>