how to convert url with query string to url without query string

N

nick

Hi All,

I would appreciate any help in converting an url with query string
(http://mywebsite/cgi-bin/web_case_mgt.exe?
CASE_KEY=00000000630520110213&STYPE=DISPLAY) to one that does not
contain any parameters (http://mywebsite/cgi-bin/web_case_mgt.exe). My
application is a cgi application with the server side generating
dynamic html pages (using C++). On the server side I am replacing the
current web page (web_new_case.exe) with a new one by generating the
following JavaScript code:
<form>
<Script language="JavaScript" type="text/javascript">
location.replace("web_case_mgt.exe?CASE_ID=12343&STYPE=DISPLAY");
</script>
</form>

NOTE: web_new_case.exe and web_case_mgt.exe are programs running in
the background and listening to a socket.

Question: What Javascript code should I use to achieve the desired
effect?
 
D

David Mark

Hi All,

I would appreciate any help in converting an url with query string
(http://mywebsite/cgi-bin/web_case_mgt.exe?
CASE_KEY=00000000630520110213&STYPE=DISPLAY) to one that does not
contain any parameters (http://mywebsite/cgi-bin/web_case_mgt.exe). My
application is a cgi application with the server side generating
dynamic html pages (using C++). On the server side I am replacing the
current web page (web_new_case.exe) with a new one by generating the
following JavaScript code:
Markup.

<form>

Why a form?
<Script language="JavaScript" type="text/javascript">

Start tag doesn't match the end and the language attribute is
deprecated.
location.replace("web_case_mgt.exe?CASE_ID=12343&STYPE=DISPLAY");
</script>
</form>

And why wouldn't you redirect with a location header? Your approach
will fail if scripting is disabled (among other ways).
NOTE: web_new_case.exe and web_case_mgt.exe are programs running in
the background and listening to a socket.

Noted. :)
Question: What Javascript code should I use to achieve the desired
effect?

https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/replace

But I think you should be doing this server side.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top