Can u insert a java script into php ? I am inserting an image that shows the status of the live help desk. I tried it and an error shows up - unexpected string.
Sure.. watch your quotes though. If you are using echo/print echo "<script language=javascript>"; then you have to escape any "quotes" in your script with \"
PHP outputs text, whether that's html, xml, csv or javascript. The PHP has to be right, then view the source see if that's right too. Use firefox's awesome debugger $s.= just means append this onto the string. that error you are getting means that PHP can't use the text it's getting as text - it doesn't give a damn what's in that text. It's probably a case of escaping your quotes. show us what's on that line.
If the JavaScript is non-dynamic (as in, it doesn't change, or at least doesn't change much), the easiest thing to do is to break out of your PHP and just write the JavaScript directly as if it were in HTML... That is to say, use: ?> to stop the PHP parser then write your JavaScript as if it were in an HTML page then use: <?php to start the PHP parser up again...