Regex

P

Phat G5 (G3)

Trying RegExp and having troubles. I need to remove specific items from a
link. I wrote this

var re = new RegExp('/&bulk=' + ckBox.value + '*/gi');
if( document.getElementById("next1") )
document.getElementById("next1").href.replace(re ,'');
if( document.getElementById("prev1") )
document.getElementById("prev1").href.replace(re ,'');


I just cant get it to replace the &bulk=number correctly...

Any advice appreciated!

-S
 
P

Phat G5 (G3)

Trying RegExp and having troubles. I need to remove specific items from a
link. I wrote this

var re = new RegExp('/&bulk=' + ckBox.value + '*/gi');
if( document.getElementById("next1") )
document.getElementById("next1").href.replace(re ,'');
if( document.getElementById("prev1") )
document.getElementById("prev1").href.replace(re ,'');


I just cant get it to replace the &bulk=number correctly...

Any advice appreciated!

-S
Ok, stupid me... I made this mistake before. I needed to do a

str= str.replace...


Thanks

-S
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top