document.location.href not working!?!?!?!

B

Brian

can someone PLEASEEEEEEEEEE tell me why this isn't working???

-------------------- function ------------------------

function goBlank(){

newlocation = "blank.asp";
top.window.document.location.href=newlocation ;
return true;
}

-------------------------- html ------------------

<td><div align="center" ><a href="javascript:;" ><span
class="popupButton" style="text-decoration: none; line-height: 24px;"
onClick="checkin();" >&nbsp;&nbsp;&nbsp;Check In
&nbsp;&nbsp;&nbsp;</span></a></div></td>



I have tried every conceivable combination and it just wont work.. I
can see the status bar flash, like its loading a new page, but the page
doesnt change..

thanks in advance...
 
L

Lee

Brian said:
can someone PLEASEEEEEEEEEE tell me why this isn't working???

-------------------- function ------------------------

function goBlank(){

newlocation = "blank.asp";
top.window.document.location.href=newlocation ;
return true;
}

-------------------------- html ------------------

<td><div align="center" ><a href="javascript:;" ><span
class="popupButton" style="text-decoration: none; line-height: 24px;"
onClick="checkin();" >&nbsp;&nbsp;&nbsp;Check In
&nbsp;&nbsp;&nbsp;</span></a></div></td>



I have tried every conceivable combination and it just wont work.. I
can see the status bar flash, like its loading a new page, but the page
doesnt change..

You haven't showed a function named checkin().
You seem to be abusing an <a> tag just to get the pointer icon.
I tend not to trust relative pathnames.
 
B

Brian

sorry.. that was the wrong link.... here is the correct one...


----------------------------------------------------------------------------------

<div align="right"><span class="popupButton" style="text-decoration:
none; line-height: 24px;" onClick="goBlank();" >Close
Window</span></div>


-----------------------------------------------------------------------------------------------------------


I dont know why i have the <a> tag there.. I'm using CSS to create the
hand. i just removed it.. I did try absolute paths as well.. I also
tried, "document.location.href" and "window.location.href" and
"self.location.href".. I tried putting it directly in the <span tag and
creating this function... i just dont get it..
 
B

Brian

LOL.. Thank you.. you just helped me answer it.. I took the <a> tag out
and it worked.. that is weird.. I remember I had tried putting the
onClick event in the <a> tag and it didnt work.. I guess i just kept
the <a> tag there.. thanks for your help..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,102
Messages
2,570,645
Members
47,245
Latest member
ShannonEat

Latest Threads

Top