After
it is possible to load a foreign website with a jQuery load method in div my page is ?
$ ('#content') .load ('http://www.somedomain.com/server/whatever/file.php'); This is not working for me!
You may be able to work around the security restrictions @Giorgi described using a PHP based proxy script To proxy.php Then jquery loading actions to call pages like proxy.php? Url = http% 3A // www.google.com / No, this
. & Lt ;? Php if (Isset ($ _GET ['url'])) # # Obtain the specified URL $ raw = file_get_contents ($ _GET ['url']); # RegExp to Strip All script tags and / or links in JavaScript with them. $ Safer = preg_replace ('/ /lt;script[^>]*>.*<\/script>|[\\\\\\\\\\\'] javascript:.*[\"\']/im ',' ', $ Crude); Echo $ safer; } Else {echo 'no URL set'; } preg_replace () action is just a hard draft - to ensure you Some major tests and tweaking want to prevent people from getting screwed from your site in such a way.
Comments
Post a Comment