...

View Full Version : probably simple! can't use string variable in window.location



questor
08-23-2007, 04:23 PM
x is a string variable that I can alert to myself and I know it's good. But for some reason window.location omits it. What am I not seeing?


function addProduct() {
var x = '?selection=<? echo $_GET['selection']; ?>&products=';
var frm = document.checkForm;
// Loop through all elements
for (i=1; i<frm.length; i++) {
if (frm.elements[i].checked == true) {
x += frm.elements[i].value + ',';
}
}
window.location='addItem.php'+x;
}

Fumigator
08-23-2007, 04:48 PM
That technique worked fine for me.


x='?a=22222';
window.location='page.htm'+x; //took me page.htm?a=22222

questor
08-23-2007, 06:48 PM
Works in IE but not in FF?!?

Fumigator
08-23-2007, 07:59 PM
I didn't try IE, worked in FF.

questor
08-23-2007, 08:29 PM
Not sure what changed, but as I was working on other things, it just started working. Maybe cache.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum