troubleshooting Question

Preventing specific browsers from logging in

Avatar of Lee
LeeFlag for United Kingdom of Great Britain and Northern Ireland asked on
jQueryJavaScriptScripting Languages
18 Comments2 Solutions485 ViewsLast Modified:
I reasonably proficient at javascript but I've never really ventured into using jQuery. Now I need to and I have a problem. I have a login screen. The bulk of it is generated code which I can't change but I can put stuff in the header and footer of the page. For reasons I'm not going into, I have to block everyone from logging in unless they're using IE. This is not my choice. I found jReject which seems to offer the functionality. The login screen clearly needs to run for any browser hence I thought jQuery would be a good choice.

I need to hide the div with ID of LOGONBOX if the browser isn't IE. HEre is the code so far, which, needless to say, doesn't work.

<html>
<head>
<script src="jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="jquery.reject.js" type="text/javascript"></script>
</head>
<body>
<div align="center">
  <table width="95%" height="95%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td align="center" valign="middle">
        <table width="600" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="1" colspan="3" style="background-color:#">
            </td>
            <td rowspan="3" width="1" style="background-color:#">
            </td>
          </tr>
          <tr>
		  <td height="100" width="43" style="background-color:#FFFFFF"></td>
		  <td height="100" width="372" style="background-image:url(#left2.jpg);background-position: top left"></td>
            <td height="100" width="185" style="background-image:url(#right1.jpg);background-position: top right"></td>
			</tr><tr><td width="43" height="300" align="left" bgcolor="#FFFFFF"></td><td width="372" height="300" align="left" bgcolor="#FFFFFF">
            <input type="hidden">
            <FORM AUTOCOMPLETE="off" name=lForm METHOD="POST" ACTION="/Secure/Logon.aspx"><BR>
            <DIV ID=LOGONBOX>
            <TABLE CLASS=IPan>
            <TR>
            <TD>User &nbsp; </TD><TD><input name="uid" value="" maxlength=50 size=20  style="width:200"></TD>
            </TR>
            <TR>
            <TD>Password</TD><TD><input type="password" CLASS="pedit" name="pword" value="" maxlength=20 size=20 style="width:200"></TD>
            </TR>
            <TR>
            <TD COLSPAN=2><input type=Submit value="Log On">
            </td>
            </tr>
            </TABLE></DIV></FORM>
            </td>
            <td height="300" width="185" style="background-image:url(#right2.jpg)"></td>
            </td>
          </tr>
          <tr>
		  <td width="1" rowspan="3" style="background-color:#">
            </td>
			<td height="1" colspan="3" style="background-color:#">
            </td>
          </tr>
        </table>
	  </td>
    </tr>
  </table>
</div>
</body>
<script>
$(document).ready(function()
{
  $("div.LOGONBOX").hide();
});
</script>
</html>

The jReject library I got from here http://jreject.turnwheel.com/
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 18 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 18 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros