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 Link to comment https://forums.phpfreaks.com/topic/22493-php-javascript/ 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! Link to comment https://forums.phpfreaks.com/topic/22493-php-javascript/#findComment-100852 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.