Reputation: 4203
<script language="JavaScript" type="text/javascript">
if (location.href.indexOf('?dest=') > 0)
window.open('/about.aspx', '', '')
</script>
how do i make this work. Its in aspx file.
Upvotes: 0
Views: 1131
Reputation: 1912
Your issue is the location.href...
part. It needs to be window.location.href...
if (window.location.href.indexOf('?dest=') > 0){
window.open('/about.aspx'+window.location.search, '', '');
}
Cheers
Upvotes: 0
Reputation: 2312
The following script will test for the existence of the 'dest=' key in the current page's querystring, and if it exists, will open a window to about.aspx with the querystring appended to the URL.
<script language="JavaScript" type="text/javascript">
if (window.location.search.indexOf('dest=') > 0) {
window.open('/about.aspx' + window.location.search, '', '');
}
</script>
Upvotes: 2
Reputation: 7098
Change the window.open line to
window.location = '/about.aspx';
Include the semicolon, which is missing in your code.
Upvotes: 0