Note that there are some explanatory texts on larger screens.

plurals
  1. POWeird issue with jquery versions, ajax, and Internet Explorer
    primarykey
    data
    text
    <p>I'll save as much of the backstory as possible, but here's what I'm trying to figure out.</p> <p>I have two dropdowns, the first is a list of states, the 2nd is the schools in that state. Changing the select triggers a listing of the schools with json and php.</p> <p>Using jquery 1.3.2, everything works fine in Firefox and IE9. In IE8 I get a syntax error pointing to the 'for' loop and script does not work. If I can figure out what the issue is with the 'for' loop and can actually make the script work with 1.3.2, that's fine.</p> <p>I tried upgrading to 1.4.4 or any newer version of jquery, and when I do that, the script doesn't work at all, in any browser and through research I haven't been able to figure out why.</p> <p>For what it's worth I also used getJSON instead of ajax, if that makes a difference anywhere.</p> <pre><code>$(document).ready(function(){ $("select#addr_state").change(function(){ $.ajax({ url: 'schools.php', dataType: 'json', cache: false, data: {id: $(this).val(), type: "list"}, success: function(j){ var options = ''; for (var i = 0; i &lt; j.length; i++) { options += "&lt;option value='" + j[i].optionValue + "'&gt;" + j[i].optionDisplay + "&lt;/option&gt;"; } $("select#school_id").html(options); } }); }) }) </code></pre> <p>For those who wanted to see the error, it wouldn't let me post a screenshot as a new member. I am using browserstack to test and they are using CompanionJS. I get just "Syntax error" on line 41 (the for loop), then on line 42 "'OptionValue' is null or not an object", under that there are references to the jquery.min.js file, line 19.</p> <p>Thanks in advance for any replies.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload