Click here to Skip to main content
15,922,419 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: "Intelligent" Drop Down Pin
michelly_belly20-Apr-06 5:03
michelly_belly20-Apr-06 5:03 
GeneralRe: "Intelligent" Drop Down Pin
Guffa19-Apr-06 13:01
Guffa19-Apr-06 13:01 
QuestionRemove Close button from Browser Pop-up Pin
SACHIN_A18-Apr-06 19:45
SACHIN_A18-Apr-06 19:45 
AnswerRe: Remove Close button from Browser Pop-up Pin
Vasudevan Deepak Kumar19-Apr-06 23:33
Vasudevan Deepak Kumar19-Apr-06 23:33 
QuestionWhere the technology is heading to? Pin
Waheed Ashraf18-Apr-06 10:04
Waheed Ashraf18-Apr-06 10:04 
AnswerRe: Where the technology is heading to? Pin
HimaBindu Vejella20-Apr-06 20:23
HimaBindu Vejella20-Apr-06 20:23 
QuestionRemoving a simple pattern from a string! Pin
Mehdi Mousavi18-Apr-06 6:18
Mehdi Mousavi18-Apr-06 6:18 
AnswerRe: Removing a simple pattern from a string! Pin
Guffa18-Apr-06 7:14
Guffa18-Apr-06 7:14 
Perhaps you should mention what the problem is? It would greatly simplify fixing it... Wink | ;)

I don't think that your replace is working the way you think. At least you should skip the first item in the array, as it contains the entire matched string, not a matched group.

Why don't you just use the RegExp object in a replace?

function removeParam(str, name)<br />
{<br />
        var rgx = new RegExp('(^|; )' + name + '=\\w*(?:; )?');<br />
        rgx.global = true;<br />
        rgx.ignoreCase = true;<br />
        return str.replace(rgx, '$1');<br />
}


I simplified the expression a bit, and made it aware of the beginning of the string or the separator before the name, so that it doesn't mess up other values. Otherwise removing the "on" property from "on=42; ASPNETSESSION=WHATEVER" would result in "ASPNETSESSI".

Reservation for typos, though. The code is not tested.

---
b { font-weight: normal; }

QuestionWe have all brands of Mobile Phones,Ipods,Sidekicks,Nextels phone,Laptops for sell at cheap and Pin
vallentino18-Apr-06 5:30
vallentino18-Apr-06 5:30 
AnswerRe: We have all brands of Mobile Phones,Ipods,Sidekicks,Nextels phone,Laptops for sell at cheap and Pin
J4amieC18-Apr-06 5:34
J4amieC18-Apr-06 5:34 
AnswerRe: We have all brands of Mobile Phones,Ipods,Sidekicks,Nextels phone,Laptops for sell at cheap and Pin
Shog918-Apr-06 17:10
sitebuilderShog918-Apr-06 17:10 
QuestionSame page loaded from different button click Pin
Jane2018-Apr-06 4:20
Jane2018-Apr-06 4:20 
AnswerRe: Same page loaded from different button click Pin
enjoycrack19-Apr-06 0:53
enjoycrack19-Apr-06 0:53 
GeneralRe: Same page loaded from different button click Pin
Jane2020-Apr-06 4:21
Jane2020-Apr-06 4:21 
GeneralRe: Same page loaded from different button click Pin
Jane2020-Apr-06 4:24
Jane2020-Apr-06 4:24 
QuestionDoubleclick Pin
Larza12318-Apr-06 2:56
Larza12318-Apr-06 2:56 
AnswerRe: Doubleclick Pin
J4amieC18-Apr-06 3:30
J4amieC18-Apr-06 3:30 
GeneralRe: Doubleclick Pin
Larza12318-Apr-06 20:40
Larza12318-Apr-06 20:40 
AnswerRe: Doubleclick Pin
alexey N19-Apr-06 0:13
alexey N19-Apr-06 0:13 
GeneralRe: Doubleclick Pin
Larza12319-Apr-06 21:11
Larza12319-Apr-06 21:11 
QuestionUpdating WebService Pin
Spaz8018-Apr-06 2:43
Spaz8018-Apr-06 2:43 
QuestionDynamic DIV Pin
CoolASL18-Apr-06 1:53
CoolASL18-Apr-06 1:53 
AnswerRe: Dynamic DIV Pin
alexey N18-Apr-06 1:58
alexey N18-Apr-06 1:58 
GeneralRe: Dynamic DIV Pin
CoolASL18-Apr-06 2:01
CoolASL18-Apr-06 2:01 
GeneralRe: Dynamic DIV Pin
alexey N18-Apr-06 2:06
alexey N18-Apr-06 2:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.