Is it possible to load a foreign website into a div of my page with the jQuery load method?
$('#content').load('http://www.somedomain.com/server/whatever/file.php');
It’s not working for me!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You might be able to work around the security restriction described by @Giorgi using a PHP-based proxy script.
proxy.php
Then use the jQuery load action to call pages like proxy.php?url=http%3A//www.google.com/
Not, the
preg_replace()action is just a rough draft – you would want to do some major testing and tweaking to ensure that you prevent people from messing with your site this way.