|
innerHTML makes life so simple, yet Microsoft can't support it. It would be so easy if they would just support it. Is there any secret to using innerHTML with IE that I haven't heard of, because I can never get them to work together
Last Edit: Jan 28, 2007 0:50:56 GMT by Mithras
|
Support Rob Scuderi, the #1 Penguins Defender!
"Behold: me! I have authority in this building."
|
|
|
|
I must be rustier than I thought. >_> document.body.innerHTML += "<b>Blah</b>"; Works fine. And as for your simplicity remark, innerHTML isn't always preferable to stricter DOM methods.
Last Edit: Jan 28, 2007 2:21:15 GMT by Aaron
|
|
|
|
I must be rustier than I thought. >_> document.body.innerHTML += "<b>Blah</b>"; Works fine. And as for your simplicity remark, innerHTML isn't always preferable to stricter DOM methods. I mean checking for innerHTML. I know it's not the best method, but it's the easiest >.<
|
Support Rob Scuderi, the #1 Penguins Defender!
"Behold: me! I have authority in this building."
|
|
|
|
Oh, so you mean that they don't read RegExp the same or something?
|
wat
|
|
|
|
The innerHTML property isn't part of the W3C DOM. Nevertheless, it enjoys better cross-browser support than other W3C standard properties and methods so I wouldn't think it would be a problem. However, note; But, Firefox 1.5 and it's predecessors support the use of innerHTML on XHTML documents. It is more compatible to use methods like createTextNode and appendChild but innerHTML is faster. So that's probably the cause of the problem for you, Mithras.
Last Edit: Jan 28, 2007 14:04:16 GMT by Andrew
|
|
|
|
Oh, so you mean that they don't read RegExp the same or something? Yes, I'm trying to grab the font tag that the Modify Profile link is in (on your Profile page), and add to it, but IE is making this simple task difficult >.<
|
Support Rob Scuderi, the #1 Penguins Defender!
"Behold: me! I have authority in this building."
|
|
|
|
I am having that same exact problem, only a little different. I'm trying to grab the MSN contact information for a profile page mod, and it's not working in IE. It works just fine in Firefox and Opera, both of which are closer to web standards than IE can ever meet. Now, I'm going to have to rewrite the entire code because of it.
|
wat
|
|
|
|
Quotes aren't rendered inside tags in IE. FF: <a href="?action=whee">Dude</a> IE: <A HREF=?action=whee>Dude</A> (Or something like that. ) Therefore, you could either do something like /<a href="?\?action=whee"?>.+?<\/a>/i To check the rendered source, put this in the browser URL: javascript:"<xmp>"+document.body.innerHTML+"</xmp>"; It doesn't work in Opera unfortunately, but the fix is "textarea" instead of "xmp" Hope that helps. Oh, and Cali taught me that trick.
|
|
|
|
|
In internet explorer, innerHTML always returns tag names in uppercase and as Chris said, it only supplies the quotations in certain cases. Open IE and alert the body's innerHTML here. You'll see that certain attributes are quoted while others are not. I haven't looked into it so i'm not sure why. Edit: Oh and Chris, I believe it's only the tag names that are uppercase, the attribute names print directly as they appear in the source.
Last Edit: Jan 28, 2007 21:53:54 GMT by Aaron
|
|
|
|
Edit: Oh and Chris, I believe it's only the tag names that are uppercase, the attribute names print directly as they appear in the source. Just checked, and yeah, you're right. Also, quotes appears around inline styles. Just thought I'd point that out.
|
|
|
|
|
Quotes rarely show up in IE, I know. You use "? instead of ". I learned that a long time ago. I think it's mainly just the rendering technique. You could use DOM to loop through the childnodes instead. Then, you could check for tag names to grab multiple tags. For example: obj.childNodes.nodeName == 'FONT'; or something like that.
|
wat
|
|
|
|
Quotes aren't rendered inside tags in IE. FF: <a href="?action=whee">Dude</a> IE: <A HREF=?action=whee>Dude</A> (Or something like that. ) That is something that you should put in big bold red letters with flashing lights around it at the top of the page about innerHTML. I got it to work... I was stumped because I had no way of grabbing the <font> tag with bookmarks in it on other user's pages, but then I realized that they have the Send PM link
|
Support Rob Scuderi, the #1 Penguins Defender!
"Behold: me! I have authority in this building."
|
|
|
|
I'd just loop HR's personally. *shrugs*
|
|
|
|