artvolk
artvolk

Reputation: 9518

JQuery behaves strange with different IE8 security settings

Good day!

I'm not sure if I hit the bug, so please confirm that I'm not mad. I use IE 8.0.7600.16385 on 3 different machines.

Here is simple page (I tested with both JQuery 1.4.2 and 1.3.2). It just displays alert if hidden link is visible. It displays 'false' in all browsers I have and in my IE8 when security zone is set to 'Trusted intranet' or it in IE7 compatibility mode. But when I upload this page (or change security zone to 'Internet') -- it displays 'true'.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="ru">
<head>
    <title>     
    </title>       
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />       
        <script type="text/javascript" src="js/jquery.js"></script> 
</head>

<body>
<script type="text/javascript">
    $(function(){
        $('#vct-save-settings').click(function(){
            alert('Is visible hidden element: ' + $('#vct-show-similar').is(':visible'));           
        });
    });
</script>

<div class="vct-controls">
    <a href="#" id="vct-hide-similar">Shown element</a>
    <a href="#" id="vct-show-similar" style="display: none;">Hidden element</a>
    <a href="#" id="vct-save-settings">click me!</a>
</div>

</body>
</html>

So, the question is: why JQuery behaves different regardless of IE8 security zones?

Thanks in advance!

Upvotes: 4

Views: 941

Answers (1)

Pointy
Pointy

Reputation: 413682

Already logged in the jQuery bug tracker (bug 6199).

edit — also it just occurred to me that this might be a security thing related to the trick of putting a <a> tag on a page and having a ":visited" style for it, and then checking its current style via Javascript. That way, a page can tell what other sites you have visited. I don't know why this behavior in particular should result, but that's the only reason I can imagine that the security zone would figure into the behavior.

Upvotes: 1

Related Questions