OZONE Asylum
Forums
CSS - DOM - XHTML - XML - XSL - XSLT
JavaScript Regex Issue
This page's ID:
29317
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
First of all, hello and welcome to the Asylum. You should escape the value of the tags before injecting them into a RegExp. Or, another, faster in theory, method is to not use any Regexp, i.e:[code]var old_vin = get_text(vn.getElementsByTagName('old').item(0)) ,new_vin = get_text(vn.getElementsByTagName('new').item(0)) ,new_value = $F(el).split( old_vin ).join( new_vin ); if( new_vin==new_value.replace( /^\s+|\s+$/g, '' ) ) new_value = 'test'; $(el).value = new_value;[/code]Hope that helps, [url=http://www.p01.org/][sigrotate][img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_neon88x31.gif[/img][/sigrotate][/url] [small](Edited by [url=http://www.ozoneasylum.com/user/2185]poi[/url] on 06-29-2007 03:03)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »