[Proto-Scripty] Re: Hide or Remove non-HTML element from HTML

2010-04-21 Thread Jelks
On Apr 20, 5:13 pm, T.J. Crowder t...@crowdersoftware.com wrote: document.observe(dom:loaded, function() {     $$('AsyncException').invoke('remove');}); For some reason, that gives me a script error in IE (I have IE to always show any JS errors) What version of Prototype and IE are

[Proto-Scripty] Re: Hide or Remove non-HTML element from HTML

2010-04-20 Thread Jelks
Let me rephrase the question... Given that this is generated: form ... input ... AsyncExceptionError occured during AsyncInvocation./ AsyncException some more real html form stuff... /form In the IE HTML DOM, that XML snippet becomes three nodes:

RE: [Proto-Scripty] Re: Hide or Remove non-HTML element from HTML

2010-04-20 Thread Jonathan Rosenberg
] On Behalf Of Jelks Sent: Tuesday, April 20, 2010 9:39 AM To: Prototype script.aculo.us Subject: [Proto-Scripty] Re: Hide or Remove non-HTML element from HTML Let me rephrase the question... Given that this is generated: form ... input ... AsyncExceptionError occured during

[Proto-Scripty] Re: Hide or Remove non-HTML element from HTML

2010-04-20 Thread Jelks
On Apr 20, 10:08 am, Jonathan Rosenberg j...@tabbysplace.org wrote: How about using Xpath from Javascript to find the nodes?  Very simple. Simple? How so? This is not an XML document, this is an HTML page that happens to have one non-HTML element in it. All the other browsers add it to the

Re: [Proto-Scripty] Re: Hide or Remove non-HTML element from HTML

2010-04-20 Thread Alex Wallace
The non-HTML element can be tricked into appearing to be an actual HTML element if you use: document.create(fakeElementTagName); somewhere on the page. Once that's done, IE will treat fakeElementTagNamefoo-bar/fakeElementTagName as an actual DOM element, and you should be able to remove it using

RE: [Proto-Scripty] Re: Hide or Remove non-HTML element from HTML

2010-04-20 Thread Jonathan Rosenberg
Subject: [Proto-Scripty] Re: Hide or Remove non-HTML element from HTML On Apr 20, 10:08 am, Jonathan Rosenberg j...@tabbysplace.org wrote: How about using Xpath from Javascript to find the nodes?  Very simple. Simple? How so? This is not an XML document, this is an HTML page that happens

[Proto-Scripty] Re: Hide or Remove non-HTML element from HTML

2010-04-20 Thread Jelks
On Apr 20, 10:43 am, Jonathan Rosenberg j...@tabbysplace.org wrote: Ok, so I was too glib.  Maybe it's not very simple. 1) Do you have control of the delivery of this document at the server side? Only somewhat. If I had total control, I would not be letting this AsyncExceptionError

RE: [Proto-Scripty] Re: Hide or Remove non-HTML element from HTML

2010-04-20 Thread Rick . Wellman
-scriptacul...@googlegroups.com] On Behalf Of Jelks Sent: Tuesday, April 20, 2010 10:36 AM To: Prototype script.aculo.us Subject: [Proto-Scripty] Re: Hide or Remove non-HTML element from HTML On Apr 20, 10:43 am, Jonathan Rosenberg j...@tabbysplace.org wrote: Ok, so I was too glib.  Maybe it's

[Proto-Scripty] Re: Hide or Remove non-HTML element from HTML

2010-04-20 Thread Jelks
On Apr 20, 10:41 am, Alex Wallace alexmlwall...@gmail.com wrote: The non-HTML element can be tricked into appearing to be an actual HTML element if you use: document.create(fakeElementTagName); somewhere on the page. Once that's done, IE will treat fakeElementTagNamefoo-bar/fakeElementTagName

Re: [Proto-Scripty] Re: Hide or Remove non-HTML element from HTML

2010-04-20 Thread Alex Wallace
In theory, yes. The three nodes is how IE represents supposedly invalid DOM nodes. By utilizing document.createElement(fakeDomNodeName), the IE DOM starts to think that those invalid nodes are in fact actual elements. Using this technique allows you to use CSS to target and style HTML5-specific

Re: [Proto-Scripty] Re: Hide or Remove non-HTML element from HTML

2010-04-20 Thread Walter Lee Davis
It's a shame that Firefox doesn't allow this. I was hoping to style an input type=search using this trick. Walter On Apr 20, 2010, at 12:11 PM, T.J. Crowder wrote: @Jelks: What Alex is saying that IE has the ability to let you *tell it* that that's really an element. At the very beginning

[Proto-Scripty] Re: Hide or Remove non-HTML element from HTML

2010-04-20 Thread T.J. Crowder
@walter: It's a shame that Firefox doesn't allow this. I was hoping to style an   input type=search using this trick. Just the normal styling rule works find on my copy of Firefox (v. 3.6.3) input[type=search] { background-color: red; } -- T.J. :-) On Apr 20, 5:18 pm, Walter Lee

[Proto-Scripty] Re: Hide or Remove non-HTML element from HTML

2010-04-20 Thread Jelks
Wow. Thank you and Alex so much! I had no idea you could do that with document.createElement(). (And Alex, thanks to the link to John Resig's blog on this!) Your solution works, and the infernal snippet is now banished to the hinterlands forever in all browsers. :) [one more comment inline

[Proto-Scripty] Re: Hide or Remove non-HTML element from HTML

2010-04-20 Thread T.J. Crowder
Hi, On Apr 20, 7:59 pm, Jelks jelks.caban...@gmail.com wrote: Wow.  Thank you and Alex so much!  I had no idea you could do that with document.createElement(). Cool, huh? ;-) Most of the credit to Alex, I hadn't remembered that until he pointed it out. Your solution works, and the infernal

[Proto-Scripty] Re: Hide or Remove non-HTML element from HTML

2010-04-19 Thread Jelks
On Apr 19, 4:25 pm, Alex Wallace alexmlwall...@gmail.com wrote: Because of a third-party control for ASP.NET we're using, under certain conditions, the generated HTML has this little gem shortly after the opening form tag: AsyncExceptionError occured during