PDA

View Full Version : Hiding onClick trouble


Crash1hd
05-15-2003, 08:39 AM
I dont know if this would be an asp question or javascript question!

but here is the code question to follow!

<%
DIM SQL, HRS
SQL = "Select userid, UserName From members Order By userid"
Set HRS = Conn.Execute(SQL)
do until HRS.EOF
IF HRS.fields("userid") = Session("userid") Then
If Session("allow") = "Lok" Then
response.write"<P align=""center""><a href=/include/utility.asp?method=abandon onClick=location.reload()>" & HRS.fields("username") & " You are curently logged in click here to log out </a></p>"
response.write"<Div style='position:absolute; top:0; left:0%; z-index: 1'><font color=red>" & Session("Clearance") & "</font></div>"
End If
End If
HRS.movenext
Loop
CleanUp2(HRS)
%>

ok the area marked in red onClick=location.reload is needed for mozzila or a getElementbyid and helps stop the back click on a members only page! but as you may have already guessed if you click on the link in IE it runs the onClick before the method part and you have to click it 2 times to work? so I need a way of hiding that code from ie but allowing mozzila to see it? sounds more like a javascript problem but thought that I would try here first

raf
05-15-2003, 06:39 PM
Use a javascript browsercheck. No ? Run a search on the javascript forums and you'll find some

Crash1hd
05-16-2003, 07:01 AM
yep posted it on the javascript forum but then figured it out myself leaving this on here for others

p.s. here it the link to the other post

http://www.codingforums.com/showthread.php?s=&postid=100625#post100625

also if anyone wants to know how to stop the back clicking on netscape and IE all you have to do is put any include files before the no caching code like so

<%@Language=VBScript%>
<!--#INCLUDE Virtual="/Include/level9.asp"-->
<!--#INCLUDE Virtual="/Include/Header.asp"-->

<% Response.expires = "-15000" %>
<% Response.CacheControl = "no-cache" %>

I have seen other post on the same trouble!