Hi,
I am stuck. I am trying to put some lines of javascript code in a php file
The excerpt of the code looks like this:
<?php
....
echo 'var count=0;';
echo 'var ns6=document.getElementById&&!document.all';
echo 'var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1';
echo 'if (ie4||ns6){
document.write('<form name="headline"><input type="button" name="display_msg" style="font-size:12px;color:#1c6f41;font-weight:bold;background:transparent; width:'+barwidth+'; height:12; border-width:0; border-color:#1c6f41;" onmouseover="this.style.background=mouseover_color" onmouseout="this.style.background=mouseout_color"></form>');
}';
echo 'function init_news_bar(){
document.news_bar.display_msg.value=msgs[count];
}';
...
?>
I am having trouble with the highlighted section, where in the javascript already has a mixture of " and ' already, I can't use echo 'xyz'; how do I get around that?
Any help will be greatly appreciated.
MacPC
I am stuck. I am trying to put some lines of javascript code in a php file
The excerpt of the code looks like this:
<?php
....
echo 'var count=0;';
echo 'var ns6=document.getElementById&&!document.all';
echo 'var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1';
echo 'if (ie4||ns6){
document.write('<form name="headline"><input type="button" name="display_msg" style="font-size:12px;color:#1c6f41;font-weight:bold;background:transparent; width:'+barwidth+'; height:12; border-width:0; border-color:#1c6f41;" onmouseover="this.style.background=mouseover_color" onmouseout="this.style.background=mouseout_color"></form>');
}';
echo 'function init_news_bar(){
document.news_bar.display_msg.value=msgs[count];
}';
...
?>
I am having trouble with the highlighted section, where in the javascript already has a mixture of " and ' already, I can't use echo 'xyz'; how do I get around that?
Any help will be greatly appreciated.
MacPC