Link to home
Start Free TrialLog in
Avatar of MsFox
MsFox

asked on

Hide part of the querystring

Hello all,

I have a javascript that calls an asp pages which in turn calls the same javascript.

SECUREINDEX.JS

var urlList;
var topstr = new String(top.location.search);
var topparamList = topstr.split("?");
var Authpos = topstr.indexOf("AuthPostBack");
if (Authpos>0) {}
else {
var urlList = topparamList[1].split("&");
location = '/INTRANET/PRODUCTION/mm4applications/ConfigFiles/SecureAccess/SecureIndexConfig.asp?Page='+ urlList[1] ;
}

Here, I'm checking for the occurence of 'AuthPostBack' in the querystring.  If there's none, then call the asp page.

My asp page contains code that checks if user has access after entering the username and password, will display error message if he has no access.

SECUREINDEXCONFIG.ASP (html part)
<BODY >
<form name="ConfigForm"  action="http://sydintra01/intranet/firm/me.get?site.sitelayouts.home&<%=request.querystring("Page")%>&AuthPostBack=true" method = "post"  target=_top  >
</form>
<script language="javascript">
self.document.ConfigForm.submit();
</script>
</BODY>

The action is just a call to our CMS page that calls SecureINdex.js.  My objective is to run the asp once and stops execution in the js file.  So you will notice that in SecureIndex, it will stop execution because Authpos>0 will be true.

Since in the js, I am parsing the querystring returned (using top.location.search), is it possible to hide the &AuthPostBack=true querystring.  

This is already working, I just want to hide from the user the URL

http://sydintra01/intranet/firm/me.get?site.sitelayouts.homeFFFF7918&AuthPostBack=true

and instead only show

http://sydintra01/intranet/firm/me.get?site.sitelayouts.homeFFFF7918

Thanks all.
ASKER CERTIFIED SOLUTION
Avatar of third
third
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MsFox
MsFox

ASKER

I tried that but I cannot make it to work.  Is it possible to bring the value of hidden field AuthPostBack back to the SecureINdex.js?

if ("<%=request("AuthPostBack")%>"=="true") {}
else {
var urlList = topparamList[1].split("&");
location = '/INTRANET/PRODUCTION/mm4applications/ConfigFiles/SecureAccess/SecureIndexConfig.asp?Page='+ urlList[1] ;
}