Jump to content

How to output java var in html on php page?


antonyfal

Recommended Posts

Hi.

How can i write this?. I have a page in a iframe it gets the contents of div from parent page, and outputs it to the title of a window script. I cant get to output the javascript var it only shows as +windowtitle+ .

 

here is my code: (The problem is with window title it outputs as +windowtitle+ )

 

<script type="text/javascript">

var windowtitle = document.getElementById(\''.$username.'id\').innerHTML; // i also used plain text to test this but still get +windowtitle+

 

var url_destination = \'http://'.$host.'/chat/'.$username.'/'.$profemail2.'/\';

 

var url_ajax = \'http://'.$host.'/chat/'.$username.'/'.$profemail2.'/\';

 

var online = "<a href=\"javascript:void(0);\" onclick=\"parent.dhtmlwindow.open(\''.$username.'box\', \'div\', \''.$profemail2.'\', \''+windowtitle+'\', \'width=224px,height=227px,left=200px,top=150px,resize=0,scrolling=0,center=1\'); return false\"><font style=\"padding-left:0px; width:100%; background-color:transparent;color:#000000; font-size:11px; text-decoration:none; text-align:left\">CHAT ONLINE</font></a>";

 

var offline = \'<span style=\"padding-left:0px; width:100%; background-color:transparent; color:#ff0033; font-size:11px; text-decoration:none; text-align:left\">CHAT OFFLINE</span>\';

 

document.write(\'<\' + \'script type="text/javascript" src="http://'.$host.'/chat/'.$username.'/'.$profemail2.'/chat2.js"></\' + \'script>\');

</script>

Sorry for that nicely pointed out about the java/javascript

here is my code again: (the [m][/m] tags have the php symbol on them so honest mistake there)

<script type="text/javascript">
var windowtitle = document.getElementById(\''.$username.'id\').innerHTML; // i also used plain text to test this but still get +windowtitle+var 

url_destination = \'http://'.$host.'/chat/'.$username.'/'.$profemail2.'/\';

var url_ajax = \'http://'.$host.'/chat/'.$username.'/'.$profemail2.'/\';

var online = "<a href=\"javascript:void(0);\" onclick=\"parent.dhtmlwindow.open(\''.$username.'box\', \'div\', \''.$profemail2.'\', \''+windowtitle+'\', \'width=224px,height=227px,left=200px,top=150px,resize=0,scrolling=0,center=1\'); return false\"><font style=\"padding-left:0px; width:100%; background-color:transparent;color:#000000; font-size:11px; text-decoration:none; text-align:left\">CHAT ONLINE</font></a>";

var offline = \'<span style=\"padding-left:0px; width:100%; background-color:transparent; color:#ff0033; font-size:11px; text-decoration:none; text-align:left\">CHAT OFFLINE</span>\';

document.write(\'<\' + \'script type="text/javascript" src="http://'.$host.'/chat/'.$username.'/'.$profemail2.'/chat2.js"></\' + \'script>\');</script>()

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.