PDA

View Full Version : Help with Javascript RegExp


mpmcleod
Jun-08-2006, 11:10 AM
I am having some problems with making RegExp work in both FF and IE. Specifically it has to do with the /.

In FF the following works fine:

replaceText = new RegExp(">save photo</a>\\s*\\|");
if ( replaceText.test(document.body.innerHTML) == true) {

}

but it doesn't work in IE nor in Opera.

I have tried escaping the / by using 1,2 and 3 \ but none works.

What I am trying to do is shown here:
http://mpmcleod.smugmug.com/gallery/1470992

Currently I have a second routine that is called which checks '>save photo<' and replaces just that text for IE and Opera.

thanks for any help or ideas.

Andy
Jun-08-2006, 11:12 AM
d00plicate.

http://www.dgrin.com/showthread.php?t=35735

I moved your post yesterday to the hacks forum, where you'd get better exposure. FYI, you can always find your posts, simply by clicking on your name :deal

mpmcleod
Jun-08-2006, 11:56 AM
d00plicate.

http://www.dgrin.com/showthread.php?t=35735

I moved your post yesterday to the hacks forum, where you'd get better exposure. FYI, you can always find your posts, simply by clicking on your name :deal

ok thanks.

Thought people here would know JS as well but might not check the Hacks forum.

Andy
Jun-08-2006, 12:04 PM
ok thanks.

Thought people here would know JS as well but might not check the Hacks forum.
Those that can help you, monitor both forums. It's more appropriate for the Hacks forum, really.

mpmcleod
Jun-08-2006, 01:55 PM
Those that can help you, monitor both forums. It's more appropriate for the Hacks forum, really.

ok no prob. feel free to delete this thread from this forum.