Ticket #3003 (closed bug: invalid)
error in explorer setting unsupported css properties via ready()
| Reported by: | lsole | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.3 |
| Component: | core | Version: | 1.2.6 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
I've noticed Explorer (6,7) errors when jQuery tries to set an unsupported css property to an element via the ready() function (line 1121 char 4). It doesn't happen when the script is in the document body. I found this trying to set a "display:table" css property to an element, but it also happens with other unsupported properties.
Example markup to test this:
<html>
<head> <script type="text/javascript" src="js/jquery-1.2.6.js"></script> <script type="text/javascript"> $(function(){$('#test').css('display', 'table');}); error! </script> </head>
<body>
<div id="test">hello world!</div>
<script type="text/javascript"> $('#test').css('display', 'table'); no error! document.getElementById('test').style.display = 'table'; no error! </script>
</body>
</html>
Change History
comment:2 Changed 5 years ago by lsole
Yes, it also errors. I've found out that it even errors using the typical onload handler, and not using jQuery at all. It must be some curious IE onload-related bug (on which also jQuery relies?), because it doesn't show up when the script is in the body.
You may want to close this bug report. It would be nice that jQuery would find a workaround for this, but this is another subject.
Thanks and keep up with this good job!
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

What happens if you do that the non-jquery way inside the document ready ? Does that error ?