Click to See Complete Forum and Search --> : Please Help with location.replace


farthernorth
01-15-2004, 10:35 AM
I know nothing about Javascript -- this is as far as I have gotten, but can't make it work any farther.

I want to get rid of the top line - but the location.replace is not passing the variables. I am not sure how to combine them. I have a feeling it is so basic I should know exactly how to do it.

document.writeln('<a href="javascreen2.cfm?scrw=' + screen.availWidth + '&scrh=' +screen.availHeight + '">Pass as URL vars</a>');
location.replace("javascreen2.cfm?scrw=' + screen.availWidth + '&scrh=' +screen.availHeight + '");

Please help!

Pittimann
01-15-2004, 11:12 AM
Hi!

Seems you have copied the double quotes belonging to href=

Please try this:
location.replace('javascreen2.cfm?scrw=' + screen.availWidth + '&scrh=' +screen.availHeight);

Cheers - Pit

farthernorth
01-15-2004, 11:21 AM
Thank you - it works perfectly. I should have known I was having a Quote problem - my standard screw-up in CFML.

Pittimann
01-15-2004, 11:24 AM
Hi!

You're welcome ;)

Cheers - Pit