lynxus Posted August 9, 2008 Share Posted August 9, 2008 Hi guys, Please help Im trying to display the output of a php file on a normal html page. For instance, i have index.html with a div, Inside that div i want the page to load data.php from another server and display it in the index.html page. Basically it so data.php generates a normal table with soem data in, I need to insert that table into index.html ( thats on another server ) Ive tried <script language="javascript" src="http://blaaa.com/data.php"></script> But nothing happens.. Am i doing something wrong? is my .php script outputting the format wrong? Thanks G Quote Link to comment Share on other sites More sharing options...
jacksonmj Posted August 9, 2008 Share Posted August 9, 2008 <script language="javascript" src="http://blaaa.com/data.php"></script> will do nothing unless data.php outputs valid javascript. <script> runs scripts, as opposed to inserting html files into the page. Have you tried an iframe? <iframe src="http://blaaa.com/data.php"></iframe> Quote Link to comment Share on other sites More sharing options...
lynxus Posted August 9, 2008 Author Share Posted August 9, 2008 Humm, ill try an Iframe. Arnt Iframes meant to be dirty lol I suppose i could always get then php script to put it all in a document.write ? Hmmmm lol Quote Link to comment Share on other sites More sharing options...
jacksonmj Posted August 9, 2008 Share Posted August 9, 2008 Either would work. On the one hand, iframes don't autoscale according to their content, so a document.write might be better. On the other hand, making sure you've escaped quotation marks properly can get rather complicated when you're outputting html through javascript through php. 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.