/ Published in: PHP
<p>JUST TO LET YOU KNOW THIS SNIPPET IS NOT MINE THE LINK IS IN THE URL SECTION. </p>
<p>How to make AJAX queries to domains other then yours. Basically how to achieve cross domain scripting with jQuery. The technique will help you resolve the access to restricted uri denied" code: 101" problem.</p>
<p>Using this method for cross site scripting you will be able to:</p>
<ol>
<li>Make AJAX queries to any domain even those that differ from your own.</li>
<li>Use any of $.get(), $.post(), $.ajax(), $getScript(), etc. jQuery AJAX functions as your query method.</li>
</ol>
<p>You will need to put a proxy to between you and the rest of the world. This cross domain querying solution works because you actually loading the content from your own domain. You request the URL and the proxy script on your server actually loading the content from the internet and passing it over to you.</p>
<p>How to make AJAX queries to domains other then yours. Basically how to achieve cross domain scripting with jQuery. The technique will help you resolve the access to restricted uri denied" code: 101" problem.</p>
<p>Using this method for cross site scripting you will be able to:</p>
<ol>
<li>Make AJAX queries to any domain even those that differ from your own.</li>
<li>Use any of $.get(), $.post(), $.ajax(), $getScript(), etc. jQuery AJAX functions as your query method.</li>
</ol>
<p>You will need to put a proxy to between you and the rest of the world. This cross domain querying solution works because you actually loading the content from your own domain. You request the URL and the proxy script on your server actually loading the content from the internet and passing it over to you.</p>
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php // Set your return content type // Website url to open $daurl = 'http://feeds.feedburner.com/jQueryHowto'; // Get that website's content // If there is something, read and return if ($handle) { echo $buffer; } } ?> // I named the file proxy.php and made my AJAX request to this url. Here is a jQuery code example: <script> $("#rssFeeds").load("path/to/proxy.php", function(){ // Some callback functions }); </script>
URL: http://jquery-howto.blogspot.ca/2009/04/cross-domain-ajax-querying-with-jquery.html