View Full Version : Location Syntax

02-24-2003, 10:48 PM
I tried my books and searching this site and gave up so I have to ask this really novice question.

I had a graphic on my page as an href link to another page, but before jumping to the new page I want to write a cookie. So I changed the href to call a function, but can't figure out the syntax to then jump to the new page.

function WriteCookieGoToNewPage(){
saveCookie... this line works fine
location.'pageName.html' target='_top'}

I get the error messages Expected Identifier and Object Expected.


Graeme Hackston
02-24-2003, 11:58 PM
Try location.href

02-25-2003, 12:04 AM
If you mean:


instead of:


I still got the same errors.

Graeme Hackston
02-25-2003, 12:10 AM
location.href = 'pageName.html'

It might need to be like this, I'm not sure

window.location.href = 'pageName.html'

02-25-2003, 12:54 AM
It's working now, thanks:


though it didn't like target='_top' added on to the end.

Graeme Hackston
02-25-2003, 01:14 AM
Glad it works, this should help


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum