PDA

View Full Version : Url Grabbing


chrisgray999
10-01-2002, 07:57 PM
I have seen a number of websites with the following url:

http://www.site.com/out.html?ID=1

Is there a way using javascript that i can use this format to display text on the screen in a span or div tag or do i have to use a database?

e.g.

if the url is

display.html?ID=3

then it would display


"you have chosen to view the simpson's archive" or something similar.

I hope i have made it clear what i want

Thanks very much in advance,


Chris :D

ecnarongi
10-01-2002, 08:34 PM
I think you can use the window.location.href; if that equals whatever you are looking for then do something, maybe I have to read your question again.

beetle
10-01-2002, 10:12 PM
Search this forum for 'parseGetVars'

It's a function a wrote and posted in the Post a Javascript (http://www.codingforums.com/showthread.php?s=&threadid=4555) forum. I have since used it for several forum topics, most of which relate to what you ask.

Peforming the above search will get you those topics.

whammy
10-02-2002, 02:08 AM
You can do that with javascript but it's much simpler using a server-side scripting language like ASP or PHP.

chrisgray999
10-07-2002, 02:57 PM
Sorry for the delay in my reply, but my computer broke! Thanks very much for your help, Chris