batstanggt Posted July 25, 2011 Share Posted July 25, 2011 Looking for the easiest way to load an external page inside a <div> tag and have read that AJAX is probably my best bet (correct me if Im wrong). I want the page which is loaded inside the <div> tag to be selected by clicking on an image which is inside of another <div> tag. Hope I gave enough info. Any help would be appreciated ! Thanks! -SB (ps I like using php alot anyways so if theres a better way to do this *cough* php *cough* im not opposed to that either. In fact im not opposed to anything at this point javascript etc..I have taken the time to learn the basics of all of them so I'll use which ever I need but I need to know which to use) Quote Link to comment Share on other sites More sharing options...
phpSensei Posted July 25, 2011 Share Posted July 25, 2011 Your coughing ALL over me man.. ;P PHP <?php $homepage = file_get_contents('http://www.example.com/'); echo $homepage; ?> JAVASCRIPT You have to use JSONP, as Javascript is limited in this field due to some domain security issues.. Quote Link to comment Share on other sites More sharing options...
batstanggt Posted July 25, 2011 Author Share Posted July 25, 2011 Thanks for the reply Sensei **bows** lol. Would you mind explaining that PHP a lil more in depth Im still new to PHP. Will that code allow me to have a different page load in the div depending on the link clicked ? -SB Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.