Bug Tracker

Ticket #6916: test.html

File test.html, 1006 bytes (added by karger, 9 years ago)

html file that exhibits the error when loading accompanying xml

Line 
1<html>
2<head>
3<title>Test</title>
4<script src="http://code.jquery.com/jquery-1.4.2.js"></script>
5</head>
6
7<body>
8<H1>Test</H1>
9
10
11The script below demonstrates an xml parse error that occurs in IE but
12not FF.  Assuming the xml is parsed correctly, you should see an alert
13with the title of the one book in the xml document.  If the parse
14fails, you will get a parseerror alert.  This file and accompanying
15xml work fine in firefox, whather the files are remote (served by
16http) or local.  They also work fine in IE if the files are remote.
17However, if the files are stored locally, IE will generate a
18parseerror.
19
20<script>
21function testXML(xml) {
22$("Title",xml).each(function() {
23  alert($(this).text());
24});
25}
26
27function reportError(xmlhttp, status, error) {
28alert("error: " + status);
29}
30
31function test(url) {
32var xmlhttp=$.ajax(
33{
34url: url,
35data: "",
36success: testXML,
37error: reportError,
38dataType: "xml"}
39);
40}
41
42test("test.xml")
43</script>
44
45</body>
46
47</html>
48