there is using ASP, but i don't think so using javascript.
Printable View
there is using ASP, but i don't think so using javascript.
I miss my reference, but I think you can get the whole location line (including the ?... part) and then use regular expressions to extract the url. Not sure if you can get the whole line, the rest would work.
All the buzzt
CornedBee
in javascript you can,
use the window.location
var path = new String(window.location);
No, HTML is not a programming language. You could map the .htm file extension to some scripting or cgi language so it get processed before it gets served.
so how would u parse it out?
(sorry, I'm not too good with javascript.)
run it through a loop, going through every character with charAt() until you hit a ?. then set everything after that to a new string.
it's easier to use this code:
not sure if you have to use substr or substring, one uses param 2 for the last character (this is the one you don't want) and one uses param 2 as the length of the substring (this is the one you want, since no second param means from param 1 to end of string)Code:var newString = oldString.substr(indexof('?'));
All the buzzt
CornedBee
here's a function that i did a while ago:
Code:function request(obj){
var position=0;
var fullLength=0;
var value='';
url=new String(location.href);
fullLength=parseInt(url.length);
position=url.indexOf(obj);
if(position==-1 || url.charAt((position+obj.length+1))=='&'){
return '';
}else{
position += obj.length;
do{
position++;
value+=url.charAt(position);
}while(url.charAt((position+1))!='&' && (position+1)!=fullLength);
return unescape(value);
}
}
for my function just do:
var returnValue;
returnValue=request("someParam");
if the url is
...?someParam=testing¶m2=nothing
request("someParam") would equal testing
request("param2") would equal nothing
was this intended?
¶
just found out that a & followed by para converts to this sign: ¶
that's weird,!!
vbulletin has wierd things like that. i hate when it renders smilies in my code.
That's built into HTML. Like if you write ö you get ö (o umlaut).
You can switch that off. Just below the message text field is a checkbox that says "disable smilies in this post".Quote:
Originally posted by sail3005
vbulletin has wierd things like that. i hate when it renders smilies in my code.
All the buzzt
CornedBee
:) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :)