|
Q1428 Is there any way to intercept a URL and add some more parameters to the search string?
irt.org | Knowledge Base | JavaScript | Link | Q1428 [ previous next ]
Q1428 Is there any way to intercept a URL and add some more parameters to the search string?
If it is a form submission then:
<script language="JavaScript"><!--
function intercept() {
document.myform.parm1 = 'value1';
document.myform.parm2 = 'value2';
}
//--></script>
<form name="myform" onsubmit="intercept()">
<input type="hidden" name="parm1">
<input type="hidden" name="parm2">
<input type="submit">
</form>
|
If it is a link then:
<script language="JavaScript"><!--
function intercept(what) {
what.href += '&parm1=value1&parm2=value2';
}
//--></script>
<a href="alink.href?existing_parm=existing_value" onClick="intercept(this)">text link</a>
|
|
|
Copyright © 1996-2009 irt.org, All Rights Reserved.