Please note that I have omitted some code below for readability.
I have a .php file, feed.php:
Please note the assigning of variable '$a_url' in the code above. Also note the loading of the interstitial.js file (<script type="text/javascript" src="interstiti al.js">).
Here is my interstitial.js file:
I want to use the $a_url variable set in feed.php within the javascript code in the interstitial.js file. As you can see above, I tried using:
displayfiles: ['<?php echo $a_url?>'],
in addition to several other variations. Doesn't work. Any suggestions?
I have a .php file, feed.php:
Code:
<?php require_once 'config.php'; $a_url = $_POST["aurl"]; $v_url = $_POST["vurl"]; ?> <html> <head> <link rel="stylesheet" type="text/css" href="interstitial.css" /> <script type="text/javascript" src="interstitial.js"> </script> </head> <body> <iframe src = "<?=$v_url;?>" width="100%" height="100%" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" scrolling="no"></iframe> </body> </html>
Here is my interstitial.js file:
Code:
var interstitialBox={
displayfiles: ['<?php echo $a_url?>'],
createcontainer:function(){
//write out entire HTML for Interstitial Box:
document.write('<div id="interContainer">'+this.defineheader+'<div id="interContent"></div></div><div id="interVeil"></div>')
this.interContainer=document.getElementById("interContainer") //reference interstitial container
this.interVeil=document.getElementById("interVeil") //reference veil
this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
},
initialize:function(){
this.createcontainer() //write out interstitial container
this.ajaxconnect(this.displayfiles[Math.floor(Math.random()*this.displayfiles.length)], this.interContainer) //load page into content via ajax
this.dotask(window, function(){interstitialBox.hidescrollbar(); interstitialBox.getscrollbarwidth(); setTimeout("interstitialBox.showcontainer()", 100)}, "load")
this.dotask(window, function(){interstitialBox.showcontainer()}, "resize")
}
}
displayfiles: ['<?php echo $a_url?>'],
in addition to several other variations. Doesn't work. Any suggestions?
Comment