Reputation: 1306
I'm using the following code:
(abridged JavaScript)
Input = {};
Input.URL = 'http://my.script.location/script.php';
Input.populateFaculties = function() {
$('#courses').empty();
$('#courses_reset').empty();
$('#faculties').append('<select id="faculty_populated"></select>');
for (var i = 0; i < Input.courses.length; i++) {
$('#faculty_populated').append('<option value="' + Input.courses[i].Faculty_ID + '">' + Input.courses[i].Title + '</option>');
}
$('#faculty_populated').on("click", "option", function(event) {
var id = $(this).val();
UWA.Data.getJson(Input.URL + '?cmd=populateCourses&faculty=' + id, Input.populateCourses);
});
}
Input.populateCourses = function(data) {
$('#faculties').empty();
$('#courses_reset').html('<img src="/user/74/138869.png" style="width:24px;" alt="Reset options" />');
$('#courses_reset').on("click", "img", function(event) {
Input.populateFaculties();
});
$('#courses').append('<select id="courses_populated"></select>');
for (var i = 0; i < data.length; i++) {
$('#courses_populated').append('<option value="' + data[i].Course_ID + '">' + data[i].Course + '</option>');
}
}
(abridged HTML)
<tr>
<td class="left">Course</td>
<td>
<span id="faculties">
</span>
<span id="courses">
</span>
<span id="courses_reset">
</span>
</td>
</tr>
Which works perfectly in FireFox, but doesn't work in Internet Explorer 9.
It's worth noting that IE is in "Quirks" mode because of the Netvibes UWA widget framework that I'm using, so I have no control over forcing it in to standards mode.
I don't see any errors, but upon clicking the faculty drop-down, nothing happens. In FireFox, clicking the #faculty
drop-down empties #faculty
and populates #courses
.
Is there anything in this code which appears obvious as to why Internet Explorer might not process the code?
Upvotes: 1
Views: 330
Reputation: 11
It's likely an issue in or before your doctype that's causing the issue. Netvibes UWA will not put IE in quirks mode (if it does it's a bug).
Providing a link/paste to your code may help.
Upvotes: 1