By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,776 Members | 1,400 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,776 IT Pros & Developers. It's quick & easy.

how to find website root path

P: n/a
Hello,

I have a problem with an application i'm working on (Asp.net using
vb.net for developing). I'm normally used to doing middle tier
development, so my javascript skills are not up to par. Here is my problem:

I have a javascript file called 'PMP/Scripts/Popups.js' (pmp is the root
of the website). In that file is the following function:

function OpenTutorial(sTutID)
{
var sURL = '../support/tutorials.aspx?tutid=' = sTutID;
var sProperties = 'center:yes;etc..';
window.showModalDialog(sURL, self, sProperties);
}

where ../support is acutally pmp/support.

Most of the website pages are located in sub folders from the root of
the website. When editing is to be done on a record, a popup window is
called from the main page. the popup pages are in another sub folder
(i.e. pmp/review would be where review.aspx resides and the edit page
would be located at pmp/review/popups). We give the user a tutorial
icon to click on which calls the OpenTutorial function on a button click
event.

The problem is the tutorial popup page won't load properly when called
from another popup page. I've tried variations of location.href,
location.pathname, location.hostname etc.. but can't seem to get the
pages to open correctly. The most common error i get is that the url is
not correct. here is a sample of the urls being called by the function:

pmp/review/support/tutorials.aspx
pmp/feedback/support/tutorials.aspx
pmp/thirdparty/support/tutorials.aspx.

Any suggestions on how i can get the function to point to
pmp/support/tutorials.aspx regardless of where the function is being
called from?

Thanks in advance
Shawn McNiven

Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Shawn McNiven wrote on 13 mrt 2005 in comp.lang.javascript:
Any suggestions on how i can get the function to point to
pmp/support/tutorials.aspx regardless of where the function is being
called from?


/pmp/support/tutorials.aspx
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.