Re: innerHTML and PHP string parsing



Thomas 'PointedEars' Lahn said the following on 4/12/2006 8:23 AM:
endlesstide@xxxxxxxxx wrote:

Is there a PHP command to convert a $string of HTML
into something friendly for innerHTML population?

You need to escape "</" as "<\/" if PHP generates
script code as content of a HTML `script' element.

That's debatable.

PHP programming is off-topic here.

That is true, but, the implications of what PHP generates to Javascript executing in the UA *is* on-topic here. And in order to know what to do in PHP to make it JS friendly then you have to find out what is JS friendly first. And you find that out - gasp - in a Javascript newsgroup, not in a PHP group.

I get a undtermined string constant error sometimes.

"Doctor, I'm ill sometimes. What did I do wrong?"

Umm, you read too many of Thomas' Usenet posts?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
.



Relevant Pages

  • Attempt to de-mystify AJAX
    ... A javaScript enabled web browser. ... One of the first things to happen is toward the last in the html code: ... Set the onReadyStateChange handler to our processChange() function ... I like PHP so our example uses php. ...
    (comp.databases.pick)
  • Simple Javascript replace (with a twist!) of an href
    ... know this isn't that hard, i'm just a little new to javascript, and I ... so I need to change the href of a link on our php driven auction ... The reason I need to do this is that the html parser used by our ... I have spent hours searching and testing with no luck. ...
    (comp.lang.javascript)
  • Re: Doing a Text comparison
    ... So if a job description has (PHP, JSP, ColdFusion, HTML, Javascript) ... Or someone puts ColdFusion in the description and in the resume there ...
    (comp.lang.java.help)
  • Re: Wrangling Javascript from PHP
    ... What I'm after is a way of essentially coding PHP objects that then get ... Javascript in the classes and have each instance provide and/or ... generate the needed code along with the HTML. ... provide before rendering the final page and place it at the top of the ...
    (comp.lang.php)
  • Re: begining to work with php for my site
    ... I've been looking at various tutorials and see that PHP is somewhat ... and the only thing the browser sees is what you send in the html. ... But since you don't want to use javascript or frames, you have no choice but to load the entire page. ...
    (comp.lang.php)