HighDots Forums  

Problem dealing with double quotes in InnerHTML

Javascript JavaScript language (comp.lang.javascript)


Discuss Problem dealing with double quotes in InnerHTML in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #21  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: Problem dealing with double quotes in InnerHTML - 12-12-2007 , 03:09 PM






Mahernoz wrote:
Quote:
On Dec 11, 3:53 pm, RobG <rg... (AT) iinet (DOT) net.au> wrote:

I think the whole idea of using innerHTML as the source of valid XML
markup is flawed.
You did not write that; Rob did. Please learn how to quote properly.
That is even possible with Google Groups; BTDT.

See http://jibbering.com/faq/ pp.

Quote:
- Can you recommend a method which is a "better way" to take the html-
contents of a DIV from an html file and put it into a database. (this
html will be rendered on a page, so i need to make it well-formed.)
You should first understand what are SGML, HTML, XML, and XHTML. HTML as an
application of SGML does not need to fulfill XML's "well-formed" criterium,
which is why there is XHTML which is HTML reformulated as an application of
XML, which is a subset of SGML. However, MSHTML-based UAs do not support
XHTML natively to date; they use the same old tag-soup parser for that, if,
and only if served as text/html as opposed to the proper
application/xhtml+xml (on which they choke). Hence the result you observe
with `innerHTML'.

Quote:
I don't want implementation details, just a suggestion of having a
better way.
Serialize the document tree.


PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann


Reply With Quote
  #22  
Old   
Mahernoz
 
Posts: n/a

Default Re: Problem dealing with double quotes in InnerHTML - 12-14-2007 , 11:31 PM






On Dec 13, 2:09 am, Thomas 'PointedEars' Lahn <PointedE... (AT) web (DOT) de>
wrote:
Quote:
Mahernoz wrote:
On Dec 11, 3:53 pm, RobG <rg... (AT) iinet (DOT) net.au> wrote:

I think the whole idea of using innerHTML as the source of valid XML
markup is flawed.

You did not write that; Rob did. Please learn how to quote properly.
That is even possible with Google Groups; BTDT.

Seehttp://jibbering.com/faq/pp.

- Can you recommend a method which is a "better way" to take the html-
contents of a DIV from an html file and put it into a database. (this
html will be rendered on a page, so i need to make it well-formed.)

You should first understand what are SGML, HTML, XML, and XHTML. HTML as an
application of SGML does not need to fulfill XML's "well-formed" criterium,
which is why there is XHTML which is HTML reformulated as an application of
XML, which is a subset of SGML. However, MSHTML-based UAs do not support
XHTML natively to date; they use the same old tag-soup parser for that, if,
and only if served as text/html as opposed to the proper
application/xhtml+xml (on which they choke). Hence the result you observe
with `innerHTML'.

I don't want implementation details, just a suggestion of having a
better way.

Serialize the document tree.

PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Hi Friends,

I have got a valid XHTML Converter which solved my problem. This
converter converts any HTML to XHTML (wellformed XML compatible) very
easily.

Please check out : http://www.eggheadcafe.com/articles/20030317.asp

Very good converter.

Friends, Thanks for your help.

Regards,
Mahernoz



Reply With Quote
  #23  
Old   
Randy Webb
 
Posts: n/a

Default Re: Problem dealing with double quotes in InnerHTML - 12-15-2007 , 12:16 AM



Mahernoz said the following on 12/15/2007 12:31 AM:

<snip>

Quote:
Hi Friends,

I have got a valid XHTML Converter which solved my problem. This
converter converts any HTML to XHTML (wellformed XML compatible) very
easily.

Please check out : http://www.eggheadcafe.com/articles/20030317.asp

Very good converter.
Not if ~85% of the web can't process XHTML as anything but tag soup. If
you are going to do that, you may as well just use HTML4.01 Strict.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


Reply With Quote
  #24  
Old   
Mahernoz
 
Posts: n/a

Default Re: Problem dealing with double quotes in InnerHTML - 12-15-2007 , 12:58 AM



On Dec 15, 11:16 am, Randy Webb <HikksNotAtH... (AT) aol (DOT) com> wrote:
Quote:
Mahernoz said the following on 12/15/2007 12:31 AM:

snip

Hi Friends,

I have got a valid XHTML Converter which solved my problem. This
converter converts any HTML to XHTML (wellformed XML compatible) very
easily.

Please check out :http://www.eggheadcafe.com/articles/20030317.asp

Very good converter.

Not if ~85% of the web can't process XHTML as anything but tag soup. If
you are going to do that, you may as well just use HTML4.01 Strict.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/
i will need this on the admin site and the admin has a brand new
firefox, so it won't be a problem.

i am right now caught in a different soup.

I want to copy the updated contents of a div(which has a table within
which there are textbox and <select>) to another div. I am not able
to
copy the updated values of the textbox and <select> dropdowns, the
copy happens perfectly well in Internet Explorer but not in Mozilla.

*************************************
function CopyHTML()
{
document.getElementById('<%= hidAArea.ClientID %>').value
= MakeXMLParseable(document.getElementById('<%= dvAArea.ClientID
%>').innerHTML);

}
************************************

I guess i have to use http://slayeroffice.com/articles/inn...ternatives/#4a
this method. but this method also doesn't give the updated contents of
textbox and dropdowns values (if changed).

Regards,
Mahernoz


Reply With Quote
  #25  
Old   
Randy Webb
 
Posts: n/a

Default Re: Problem dealing with double quotes in InnerHTML - 12-15-2007 , 02:05 PM



Mahernoz said the following on 12/15/2007 1:58 AM:
Quote:
On Dec 15, 11:16 am, Randy Webb <HikksNotAtH... (AT) aol (DOT) com> wrote:
Mahernoz said the following on 12/15/2007 12:31 AM:

snip

Hi Friends,
I have got a valid XHTML Converter which solved my problem. This
converter converts any HTML to XHTML (wellformed XML compatible) very
easily.
Please check out :http://www.eggheadcafe.com/articles/20030317.asp
Very good converter.
Not if ~85% of the web can't process XHTML as anything but tag soup. If
you are going to do that, you may as well just use HTML4.01 Strict.

i will need this on the admin site and the admin has a brand new
firefox, so it won't be a problem.
Ahhh yes, the intranet thingie.

Quote:
i am right now caught in a different soup.

I want to copy the updated contents of a div(which has a table within
which there are textbox and <select>) to another div. I am not able
to copy the updated values of the textbox and <select> dropdowns, the
copy happens perfectly well in Internet Explorer but not in Mozilla.
What happens with innerHTML is a guess at best. If you want to copy the
present contents of form elements, then use read the HTML itself, get
what you want, and build it back yourself.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.