User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » Help with JS/xml url parsing Page [1]  
pureplayan
All American
1684 Posts
user info
edit post

wondering how you can parse information from a url and turn it into a variable to be passed into some javascript..
I have this code

var re = /^http:\/\/.*\/maps\/([^\/]*)\/?(\d*)\/?$/;
var ary = re.exec(document.location);
var username = ary[1];
var photoid = ary[2];


Which seems to work on another site, but what directory must this be put in? This is a snippet of a JS file, but what kind of html file must be implemented, because I know this code won't execute on it's on. how can it recursively work on all subdirectories you could type after the /maps/ directory?
Anyone see what I'm getting at?

4/13/2006 1:19:32 PM

Noen
All American
31346 Posts
user info
edit post

based on the questions you are asking, you don't understand the code itself. So start there.

4/13/2006 2:35:51 PM

 Message Boards » Tech Talk » Help with JS/xml url parsing Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.38 - our disclaimer.