User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 391,625 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,708 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting

Variables in the URL - and how to get them

Join Date: Jul 2006
Location: Deptford, London
Posts: 936
Reputation: MattEvans has a spectacular aura about MattEvans has a spectacular aura about 
Rep Power: 5
Solved Threads: 47
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Posting Shark

Re: Variables in the URL - and how to get them

  #4  
Feb 7th, 2007
It depends. It can be done in Javascript or using a serverside language.

Which would you rather do?

For reference, that part of the URL is called the 'query string'.

Server side langauges often have simplified interfaces to access the 'variables' in a query string. Javascript has no such interface; but it is possible to get reference to the entire URL of a page (address + query string), and to split that down into its component parts.

An example is here:

http://www.activsoftware.com/code_sa..._in_JavaScript

(That's a somewhat wasteful procedure if you want to repeatadly get at the different variables in a query string; but its not too bad if you have alot of potential variables and are only interested in a few of them)
If it only works in Internet Explorer; it doesn't work.
Reply With Quote  
All times are GMT -4. The time now is 12:37 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC