function gup( name )
{
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return "";
else
return results[1];
}
http://www.foo.com/index.html?bob=123&frank=321&tom=213#top
var frank_param = gup( 'frank' );
沒有留言:
張貼留言