IE Issue with Javascript Regex replacement -


r = r.replace(/<tr><td><\/td><\/tr>/gi, rider_html); 

...does not work in ie works in other browsers.

any ideas or alternatives?

i've come conclusion variable r must not have value in expect because regex replacement should work fine if there match. can see in this jsfiddle replace works fine if "r" has match in it.

this code fiddle , shows proper replacement in ie.

var r = "aa<tr><td></td></tr>bb"; var rider_html = " foo ";  r = r.replace(/<tr><td><\/td><\/tr>/gi, rider_html); alert(r); 

so, can't go further diagnose without knowing value of "r" , came or knowing more specific version of ie you're running in (in case can try fiddle in version yourself).

if r came html of document, string matching on bad thing because ie not keep original html around. instead reconstitutes when needed parsed page , puts things in different order (like attributes), different or no quotes around attributes, different capitalization, different spacing, etc...


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -