[Javascript] Extract portion of URL and place in form field

Colin Cochrane colin at vfs.com
Tue May 21 10:30:42 CDT 2002


>This is the string...
>http://www.mysite.com/thanks.html?cbreceipt=Z54HKPT7
>
>I'm after the Z54HKPT7.
>
>How would I do this?

// Use split.
var string="http://www.mysite.com/thanks.html?cbreceipt=Z54HKPT7";
var getit= new Array();
 getit=string.split("=");
alert(getit[1]);

// ought to do it.

cdc


Colin Cochrane
Head Instructor
Vancouver Film School New Media
http://www.vfs.com/
Tel: (604) 685-6331 Ext 209
Fax: (604) 685-6308

Vancouver Film School. Creative. Disciplined. Focused.





More information about the Javascript mailing list