473,320 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

innerHTML and PHP string parsing

Is there a PHP command to convert a $string of HTML into something
friendly for innerHTML population? I get a undtermined string constant
error sometimes.

Apr 12 '06 #1
6 6869
wrote on 12 apr 2006 in comp.lang.javascript:
Is there a PHP command to convert a $string of HTML into something
friendly for innerHTML population? I get a undtermined string constant
error sometimes.


There are no PHP commands in Javascript.

Try another NG.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Apr 12 '06 #2
en*********@gmail.com wrote:
Is there a PHP command to convert a $string of HTML into something
friendly for innerHTML population? I get a undtermined string constant
error sometimes.


Hi,

If your HTML is not suitable to insert somewhere with innerHTML, try to find
the reason WHAT is causing that.

There is no such thing as 'special innerHTML' encoding.
It is all just html, only retrieved in a different way (via XMLHttpRequest).

I would suggest you try to isolate when this happens, and call the script
that returns the offending html directly.
Then see if you agree with the returned HTML.

It could be a PHP codingmistake, or mayby you are trying to send Javascript
back. (The latter is more difficult, if this is the case: ask again.
Several solutions exists)

Regards,
Erwin Moller

Apr 12 '06 #3
en*********@gmail.com 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.
PHP programming is off-topic here.
I get a undtermined string constant error sometimes.


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

<URL:http://jibbering.com/faq/faq_notes/pots1.html>
PointedEars
Apr 12 '06 #4
Thomas 'PointedEars' Lahn wrote:
en*********@gmail.com 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.


Not necessarily.
PHP programming is off-topic here.
Exactly. OP shoudl try
alt.php
comp.lang.php
I get a undtermined string constant error sometimes.


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


LOL
<URL:http://jibbering.com/faq/faq_notes/pots1.html>


But don't parody it in this NG, right?
Apr 12 '06 #5
Thomas 'PointedEars' Lahn said the following on 4/12/2006 8:23 AM:
en*********@gmail.com 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/
Apr 12 '06 #6

"Randy Webb" <Hi************@aol.com> kirjoitti viestissä
news:CP******************************@comcast.com. ..
Thomas 'PointedEars' Lahn said the following on 4/12/2006 8:23 AM:

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


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

:-)

'Yes doctor. I love to hate them. Have I an Asperger syndrome?'
Apr 13 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sergey Batishchev | last post by:
I need to create element with some content inside. This may be any HTML stuff - tags, text. I do next Set newelem = doc.createElement("span") newelem.innerHTML = "<a...
8
by: Kyle | last post by:
I am presently making use of documentElement.innerHTML to retrieve page contents for manipulation, but I've noticed that the sting value returned is not identical to the actual page source....
11
by: kaeli | last post by:
Hey all, AFAIR, innerHTML started as MS proprietary, but Mozilla implemented it as well. Does anyone know if any other browsers support it? It is not in the W3C DOM, is it? A quick GIS seemed to...
3
by: Ralph Snart | last post by:
i've read that innerHTML is not in the W3C standards and never will be. however i've found something that i simply can't do by manipulating text nodes directly. <div id="mydiv"></div> <script...
6
by: wk | last post by:
i have a <table></table> ...and the have a string with the html that will create the table rows, columsn etc....perhaps <tr><td>a row</td></tr>. this string comes dynamically from a source and...
1
by: sonic | last post by:
Hello, I am experimenting with various ways of passing content between javascript and server. Originally i was performing xsl transformation with javascript, but I noticed some performance...
17
by: PJ | last post by:
Greetings... I have stumbled upon a small problem. I use Ajax to retrieve part of a page I need to update. I update a DIV element with the HTML contents I get from another page. It works...
8
by: Pratik Patel | last post by:
Hello, I used innerHTML to assign HTML content. but in my HTML page content have also some javascript function and it will run when page load. bu when HTML code assgin thru innerHTML then this...
6
by: PaPa | last post by:
I'm not sure this is a javascript issue or an HTML issue. I notice that when I extract the contents of a div using the innerHTML property (?), that I wind up with a literal variable (?) which...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.