evonevo Posted September 30, 2012 Share Posted September 30, 2012 Guys,I've a problem obtaining current url on Sharepoint 2007 site.This is how I get this to work: <script type="text/javascript" language="javascript">function open_win(){var pathname = window.location.pathname;window.open("http://mysite/sites/newspace/Lists/MyLinks/NewForm.aspx?Url=http://mysite" + pathname);}</script><input type="button" value="Open Window" onclick="open_win()" />(just want to pass full URL to the form under NewForm.aspx) I'm including script on below site: http://mysite/sites/...s/AllItems.aspxBut this is list site so when I'm filtering list the url becomes something like this: http://mysite/sites/...Value2=Area%202 Only then I'm clicking button and executing function.However the problem is that 'pathname' returns only '/sites/newspace/LibraryTest/Forms/AllItems.aspx' not including parameters values. Problem is that I need full url. Any ideas how to do this ? ThanksEvo Link to comment Share on other sites More sharing options...
JamesB Posted September 30, 2012 Share Posted September 30, 2012 http://www.w3schools...bj_location.asp use location.href for the full url, instead of location.pathname. Link to comment Share on other sites More sharing options...
evonevo Posted September 30, 2012 Author Share Posted September 30, 2012 Working ! Thanks James ! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now