amalosoul Posted September 29, 2006 Share Posted September 29, 2006 I have three files in which I want to include a php file using javascript:here they are1.<?php$html = '<b>This content came from our Ajax Engine</b>';?>div = document.getElementById('contentdiv');div.innerHTML = '<?php echo $html; ?>';// this is the php file2.url = "http:/localhost/page1.php"; //url=document.location.hrefxend = url.lastIndexOf("/") + 1;var base_url = url.substring(, xend);function ajax_do (url) {// Does URL begin with http?if (url.substring(, 4) != 'http') {url = base_url + url;}// Create new JS elementvar jsel = document.createElement('SCRIPT');jsel.type = 'text/javascript';jsel.src = url;// Append JS element (therefore executing the 'AJAX' call)document.body.appendChild (jsel);}//this is the engine.js Quote Link to comment Share on other sites More sharing options...
amalosoul Posted September 29, 2006 Author Share Posted September 29, 2006 For some reason that I don't understand the text in the php page is not included. Can you help me?Thank you in anticipation! 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.