Hi,
To explain the question, I have asp script which goes something like
(this is pseudo-html, just for ease of explanation):
YET...when I print the innerHTML of the element in which the above is contained, I get:
1. The "Type=Text" is missing, (how does the browser know what type of input it is?)
2. The onfocus and onblur functions are not in the order in which I wrote the html.
3. Quotes missing from Value (I'm guessing if I had a space inthe value it might retain the quotes)
Now, in the real world, my example has many more properites, and the crux of this whole issue is that I'm dynamically re-writing the html using Regular Expressions to replace certain things, such as the 'x' and 'y' hardcoded value, and many, many more things.
I wanted to do a single string.replace(regexp) in javascript to change an entire set of (up to hundreds on the page) of these elements.
My proof-of-concept on a simple table with a few rows and a few columns with simple TD's and INPUT's worked beautifully, but as I added functions and properties to the TD's and INPUT's, it fell apart due to this ordering issue, it appears I have no guarantee of which order they'll end up in!
I really, really don't want to have to write a discreet regexp for each function, sub-element, property, etc, in the element being .replaced--there are quite a few and the order really is critical if I'm to do it with a single regexp--in part because the regexp itself is created dynamically be asp, and also because each call to .replace() will add more expense--a single call is what I want.
As I said, the concept is working and will allow me to do what might otherwise take an expensive page-refresh, in a matter of milliseconds.
Is there a way to either:
A. Force the exact html as I write it
or
B. Know in advance the rules each browser (ie 6 in this case) is going to use to write the innerHTML based on my authored HTML?
Thanks very much for info on this,
--Jim
To explain the question, I have asp script which goes something like
(this is pseudo-html, just for ease of explanation):
Code:
response.write "< input type=text onfocus=""foo('y');"" onblur=""bar('x');"" value=""hello"">"
Code:
<input onblur="bar('x');" onfocus="foo('y');" value=hello>
2. The onfocus and onblur functions are not in the order in which I wrote the html.
3. Quotes missing from Value (I'm guessing if I had a space inthe value it might retain the quotes)
Now, in the real world, my example has many more properites, and the crux of this whole issue is that I'm dynamically re-writing the html using Regular Expressions to replace certain things, such as the 'x' and 'y' hardcoded value, and many, many more things.
I wanted to do a single string.replace(regexp) in javascript to change an entire set of (up to hundreds on the page) of these elements.
My proof-of-concept on a simple table with a few rows and a few columns with simple TD's and INPUT's worked beautifully, but as I added functions and properties to the TD's and INPUT's, it fell apart due to this ordering issue, it appears I have no guarantee of which order they'll end up in!
I really, really don't want to have to write a discreet regexp for each function, sub-element, property, etc, in the element being .replaced--there are quite a few and the order really is critical if I'm to do it with a single regexp--in part because the regexp itself is created dynamically be asp, and also because each call to .replace() will add more expense--a single call is what I want.
As I said, the concept is working and will allow me to do what might otherwise take an expensive page-refresh, in a matter of milliseconds.
Is there a way to either:
A. Force the exact html as I write it
or
B. Know in advance the rules each browser (ie 6 in this case) is going to use to write the innerHTML based on my authored HTML?
Thanks very much for info on this,
--Jim