|
-
May 23rd, 2003, 01:03 PM
#1
Thread Starter
Lively Member
Javascript get page (trim url)
On an asp page, I need to get the name of the current page and any parameters and send it as a return url parameter when I navigate to the next page. Basically I need to get the url and trim it to everything after the last "/".
for examlple, on this page the url is
http://www.vbforums.com/newthread.ph...ead&forumid=11
I would need a javascript function that would give me
newthread.php?s=&action=newthread&forumid=11
any ideas?
-
May 23rd, 2003, 08:32 PM
#2
Fanatic Member
Try this function.
Code:
function GetPageProps(){
var sUrl = location.href
var iPos = sUrl.lastIndexOf("/")
var sResult = sUrl.substring(iPos + 1)
return sResult;
}
www.RealisticGraphics.net
Running VS.Net Enterprise & VB 6
Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML
MSN Messenger: kmsheff
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|