?
Solved

outerHTML quotes being striped..

Posted on 2008-11-14
2
Medium Priority
?
402 Views
Last Modified: 2012-05-05
I have code that I am trying to bring in with a outerHTML it strips out the quotes for some things and not others.  Iinherited the code.   So I am trying to figure this out as well as the whole thing.   And this is the simplest code in it..   it capitalizes removes quotes does all sorts of weird things

Javascript code:

var content='<html><body onscroll="adjustPinHdgRow();"><form name="form1">';
content+=document.all.PinFields.outerHTML;
content+='</form></body></html>';
  document.DPWPIN.document.write(content);
  document.DPWPIN.document.close();
original:
<tr style="display:none;"><td id="PinFields" colspan=06 ><table id="PinTable" border=1 bordercolor=white cellspacing=0 cellpadding=0><tr><th align=left nowrap xxDft="">Pin Number&nbsp;&nbsp;</th>
 
<th align=left nowrap xxDft="">To Pin Number&nbsp;&nbsp;</th></tr><td nowrap class="celltyp3"><input type=text name="PRPIN" value="" size=31 maxlength=31 xxBKV="" xxPinRow="Y" onfocus="document.frames.parent.document.frames.parent.fldEvent(event,this);"
onblur="document.frames.parent.document.frames.parent.fldEvent(event,this);" onchange="document.frames.parent.document.frames.parent.fldEvent(event,this);" onkeydown="document.frames.parent.document.frames.parent.fldEvent(event,this);"
onkeyup="document.frames.parent.document.frames.parent.fldEvent(event,this);" onclick="document.frames.parent.document.frames.parent.fldEvent(event,this);" ondblclick="document.frames.parent.document.frames.parent.fldEvent(event,this);" class="fieldtyp3" xxDT="A" xxReq="N" xxBDsp="Y" xxBPro="N" xxEvt="A" &nbsp;</td>
 
<td nowrap class="celltyp3"><input type=text name="TOPIN" value="" size=31 maxlength=31 xxBKV="" xxPinRow="Y"
onfocus="document.frames.parent.document.frames.parent.fldEvent(event,this);" onblur="document.frames.parent.document.frames.parent.fldEvent(event,this);" onchange="document.frames.parent.document.frames.parent.fldEvent(event,this);"
onkeydown="document.frames.parent.document.frames.parent.fldEvent(event,this);" onkeyup="document.frames.parent.document.frames.parent.fldEvent(event,this);" onclick="document.frames.parent.document.frames.parent.fldEvent(event,this);"
ondblclick="document.frames.parent.document.frames.parent.fldEvent(event,this);" class="fieldtyp3" xxDT="A" xxReq="N" xxBDsp="Y" xxBPro="N" xxEvt="A" &nbsp;</td></tr>
 
outerHTML result:
 
<TD id=PinFields colSpan=6><TABLE id=PinTable border=1 cellSpacing=0 borderColor=white cellPadding=0>
<TBODY>
<TR>
<TH noWrap align=left xxDft="">Pin Number&nbsp;&nbsp;</TH>
<TH noWrap align=left xxDft="">To Pin Number&nbsp;&nbsp;</TH></TR>
<TR>
<TD class=celltyp3 noWrap><INPUT onblur=document.frames.parent.document.frames.parent.fldEvent(event,this); onkeydown=document.frames.parent.document.frames.parent.fldEvent(event,this); class=fieldtyp3 onfocus=document.frames.parent.document.frames.parent.fldEvent(event,this); ondblclick=document.frames.parent.document.frames.parent.fldEvent(event,this); onkeyup=document.frames.parent.document.frames.parent.fldEvent(event,this); onclick=document.frames.parent.document.frames.parent.fldEvent(event,this); onchange=document.frames.parent.document.frames.parent.fldEvent(event,this); maxLength=31 size=31 name=PRPIN xxEvt="A" xxBPro="N" xxBDsp="Y" xxReq="N" xxDT="A" xxBKV="" xxPinRow="Y">&nbsp;</TD>
<TD class=celltyp3 noWrap><INPUT onblur=document.frames.parent.document.frames.parent.fldEvent(event,this); onkeydown=document.frames.parent.document.frames.parent.fldEvent(event,this); class=fieldtyp3 onfocus=document.frames.parent.document.frames.parent.fldEvent(event,this); ondblclick=document.frames.parent.document.frames.parent.fldEvent(event,this); onkeyup=document.frames.parent.document.frames.parent.fldEvent(event,this); onclick=document.frames.parent.document.frames.parent.fldEvent(event,this); onchange=document.frames.parent.document.frames.parent.fldEvent(event,this); maxLength=31 size=31 name=TOPIN xxEvt="A" xxBPro="N" xxBDsp="Y" xxReq="N" xxDT="A" xxBKV="" xxPinRow="Y">&nbsp;</TD></TR>

Open in new window

0
Comment
Question by:jc_rocker
2 Comments
 
LVL 18

Accepted Solution

by:
ChetOS82 earned 750 total points
ID: 22963533
It is outputting the HTML as IE sees it.  For some reason IE capitalizes the tags, and removes quotes (it doesn't remove them if an attribute is blank).  It also reorganizes attributes.

There is no way around this.  Is it causing you problems?
0
 

Author Comment

by:jc_rocker
ID: 22963712
Like I said I inherited this code and its a nightmare.  The outerHTML takes code that is in a frame and copies it to another frame inside that frame.   That is why there is a  "document.frames.parent.document.frames.parent."   My assumption is that because there is so many onEvents and they back up so many generations that the code gets confused where one thing ends and the other begins with out the quotes.   clicking in the input fields above I simply get the message "Error: Object doesn't support this property or method"...  
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question