Lorian Posted July 27, 2006 Share Posted July 27, 2006 Say the URL of the page the JavaScript is on is http://example.com/somepage.php?id=7, how would I get the 7 from the URL using JavaScript? Cheers. Quote Link to comment Share on other sites More sharing options...
nogray Posted July 27, 2006 Share Posted July 27, 2006 If you go to my website http://www.nogray.com and download the JS library. You can access all the URL variables by including the base.js file.after you downloading the zip file, you'll need to include this in the header[code]<script language="javascript" src="nogray_lib/base.js" type="text/javascript"></script> <script language="javascript" defer src="nogray_lib/IE_loader.js" type="text/javascript"></script> [/code]and your script will access the id by[code]_GET['id'];[/code]Here is a link to all the base.js functionshttp://www.nogray.com/phpbb/viewforum.php?f=2Here is where you can download it.http://www.nogray.com/new_site/download.php Quote Link to comment Share on other sites More sharing options...
Lorian Posted July 27, 2006 Author Share Posted July 27, 2006 That worked good, thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.