Forum Moderators: open
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function getParams() {
var idx = document.URL.indexOf('?');
var params = new Array();
if (idx!= -1) {
var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
for (var i=0; i<pairs.length; i++) {
nameVal = pairs[i].split('=');
params[nameVal[0]] = nameVal[1];
}
}
return params;
}
params = getParams();
// End -->
</script>
HOWEVER... I want to set a default id, in case no other ids are passed.
I have two links on the page and this is how I am calling the array in each...
<script language = "javascript">
<!--
function openPage(PageToLoad)
{
id = unescape(params["id"]);
var url2 = 'http://www.URL.com/';
var urlfinal2 = (url2 + id);
window.open(PageToLoad);
}
//-->
</script>
<a HREF="javascript:openPage('http://www.URL.com/' + id)">LINK HERE</a>
(this one opens up the page in a new window)
and the other link is...
<script language = "javascript">
id = unescape(params["id"]);
var url = 'proveit.html?id=';
var urlfinal = (url + id);
document.write("NEED PROOF!?!".link(urlfinal))
</script>
I reallyyyyy have been trying to figure this out for about 5 days now. IF ANYONE CAN HELP... ID GREATLY! APPRECIATE IT. I know my code isnt the best... but i tried.
****SAMMY******