Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Hide part of the querystring

Posted on 2005-05-11
Medium Priority
Last Modified: 2008-02-01
Hello all,

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


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.

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

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


and instead only show


Thanks all.
Question by:MsFox
  • 2
LVL 30

Accepted Solution

third earned 100 total points
ID: 13983017
since you're using post method, you could try creating a hidden field on your form named AuthPostBack and set the value true or false.

<form name="ConfigForm"  action="http://sydintra01/intranet/firm/me.get?site.sitelayouts.home&<%=request.querystring("Page")%>" method = "post"  target=_top  >
<input type="hidden" name="AuthPostBack" value="true">

Author Comment

ID: 13983212
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?
LVL 30

Expert Comment

ID: 13983304

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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question