javascript not working ???

They have: 1,587 posts

Joined: Mar 1999

anybody got a clue why this javascript want work? i didn't include the script tags and beginning and end of the code here.

it's supposed to parse a tracking url, like http://www.whatever.com?Bob

so that Bob would be printed out.

var URLString = window.location;
var start = URLString.indexOf("?");
var end = URLString.length;
var userName = URLString.substring(start,end);
document.write(userName);

thx in advance Smiling

Traffic-Website.com free traffic, affiliate programs, hosting, & domain names.
My Site got hacked, but i'm coming back?

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi fairhousing,

What you want is: location.search

see the following thread:
http://www.javascriptcity.com/forums/showthread.php3?threadid=597

Vinny

Where the world once stood
the blades of grass cut me still

They have: 1,587 posts

Joined: Mar 1999

that's the ticket, thx vincent! Smiling

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi fairhousing,

No prob; glad to help, or as the Latinos say: "A sus ordenes"

Vinny

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.