Bug Tracker

Ticket #6728: view.html

File view.html, 2.3 KB (added by carpii, 10 years ago)

HTML file demonstrating XMLHttp exception problem

Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<head>
4        <script type="text/javascript" src="/jquery-1.4.2.js"></script> 
5        <!--<script type="text/javascript" src="/jquery-1.2.6.min.js"></script> -->
6        <script type="text/javascript">
7                $(document).ready(function() 
8                {       
9                        $("#button1").click( function(e) 
10                        {
11                                $.post("ajax.php", { a: "ir", i: 1, r: 2 });
12                                return false;
13                        });
14                });     
15        </script>
16
17        <style type="text/css">
18                div.votediv { font-size: 10px; color: #999; }
19                .vbnrm, .vbmed, .vbhi { margin: 0; padding: 0; float: left; display: inline-block; width: 20px; cursor: pointer; height: 20px;}
20                .vbhi { width: 33px; }
21                .b1 {background-position: 0 0;} .b2 {background-position: -19px 0;} .b3 {background-position: -38px 0;} .b4 {background-position: -57px 0;} .b5 {background-position: -76px 0;} .b6 {background-position: -95px 0;} .b7 {background-position: -114px 0;} .b8 {background-position: -133px 0;} .b9 {background-position: -152px 0;} .b10 {background-position: -174px 0;}
22        </style>       
23
24        <meta http-equiv="Content-Style-Type" content="text/css">
25        <meta http-equiv="Content-Script-Type" content="text/javascript">
26        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
27</head>
28
29<body id="body" style="margin: 0pt;">
30
31<br><br>
32<div class="votediv">
33<a class="b9" href="#" id="button1">CLICK ME!</a>
34</div>
35
36<br><br>
37
38Summary<br>
39-------------<br>
40
41Clicking the link does an ajax post. There is no visible response in the test case, but there should be no javascript error either.
42All this works fine in firefox.<br><br>
43
44In internet explorer 7 and 8, and jquery 1.4.2, the post will fail with a jQuery exception.<br>
45The exception occurs when it tries to create an XMLHTTPObject.<br><br>
46
47Usually if you force a reload of the page, by holding SHIFT+refresh, oddly, the link will then work. <br><br>
48
49Then go to the address bar, and hit enter so its basically using a cached copy, and the link will fail again.<br><br>
50
51This is an odd problem, and I dont know how to describe it, but the reload issue is not actually cache related that I can tell. Disabling the browser cache completely produces the same results.<br><br>
52
53Reverting to jquery 1.2.6 resolves the problem (although there might be later versions which work too) <br><br>
54 
55</body></html>