Re: executing javascript set with innerHTML in IE 7
- From: cantrell78@xxxxxxxxx
- Date: Mon, 14 Jul 2008 15:31:41 -0700 (PDT)
On Jul 14, 2:21 pm, Thomas 'PointedEars' Lahn <PointedE...@xxxxxx>
wrote:
You are welcome. Please also take heed of the recommendations about proper
quoting.
I love usenet!
This is not a code factory; you should read postings more thoroughly:
I used `_global' in the code and `global' in the explanation, but you should
get the picture anyway.
It's not a matter of not reading thoroughly, I will admit that after
over 10 years of exposure to the DOM, it and its functions, elements,
scopes, references, and after you add the cross-browser
inconsistencies - still leaves me confused. It's my comprehension that
is lacking.
Sorry, I forgot to consider a peculiarity of MSHTML that requires you to set
the `type' property of the object before you insert it in the DOM tree.
Therefore, this should work (tested positive in IE 7.0.5730.11):
var input = document.createElement("input");
if (input)
{
input.type = "button";
element.appendChild(input);
input.value = "test me";
}
This did actually work for both IE and Firefox, however...
Setting up the function and appending it to the input won't work for
my real-case scenario. Popping up a window is not what I'm really
trying to achieve. The script is already set in the html that I'm
returning from an Ajax call and it needs to run inside the div that I
insert it to. I didn't write any of this btw, I wouldn't have used
Ajax.
So I'll ask again if anyone else knows - is there any way to have
javascript execute if it's dynamically written to a div? For example,
html, with a script in it, returned from an Ajax response, inserted
into a div.
.
- Follow-Ups:
- Re: executing javascript set with innerHTML in IE 7
- From: Thomas 'PointedEars' Lahn
- Re: executing javascript set with innerHTML in IE 7
- References:
- executing javascript set with innerHTML in IE 7
- From: cantrell78
- Re: executing javascript set with innerHTML in IE 7
- From: Thomas 'PointedEars' Lahn
- Re: executing javascript set with innerHTML in IE 7
- From: cantrell78
- Re: executing javascript set with innerHTML in IE 7
- From: Thomas 'PointedEars' Lahn
- executing javascript set with innerHTML in IE 7
- Prev by Date: Re: changing multiple classnames
- Next by Date: Re: changing multiple classnames
- Previous by thread: Re: executing javascript set with innerHTML in IE 7
- Next by thread: Re: executing javascript set with innerHTML in IE 7
- Index(es):
Relevant Pages
|