I’m not sure that this isn’t related to a Windows Update that was done late last week, as I haven’t had time this week to be in my app. However, I know this worked before, but suddenly I am getting the error “htmlfile: Unexpected call to method or property
access.” in jquery-1.5.1.min.js when the following script is run:
$("#PhoneListDrops").bind('change', function () {
var name = $("#PhoneListDrops > option:selected").attr("value");
var label = $("#PhoneTypeAgentLabel");
if (name == 'ACD') {
$.getJSON
("/Connections/GetAgentSup", function (newdata, sel) {
var newitems = '';
$.each(newdata, function (z, agents) {
var selected = '';
if (agents.Selected) {
selected = ' checked="checked" ';
}
newitems += "<input type='radio' name='Sup_Agent' value='" + agents.Value + "' " + selected + " />" + agents.Text;
}); // end for each
$("#PhoneTypeAgent").html(newitems);
}); // end phonelistdrops change
label.show();
} // end if = ACD
else {
// we need to force a blank into the radio button if they select, then unselect ACD
var newitems = '';
newitems += "<input type='radio' name='Sup_Agent' value='' />";
$("#PhoneTypeAgent").html(newitems);
label.hide();
}
});
If I comment out the newitems line so it doesn’t try to create the radio buttons, the script no longer generates the error. This only occurs when using IE 8. I have run in Google Chrome (which shows no html errors) and Firefox and the code runs fine and
the radio buttons are rendered as they should be.
Any ideas on what might be causing this and how I might fix it?
jbrassard
Member
67 Points
30 Posts
htmlfile: Unexpected call to method or property access Error in jquery-1.5.1.min.js
Apr 26, 2012 08:02 PM|LINK
I’m not sure that this isn’t related to a Windows Update that was done late last week, as I haven’t had time this week to be in my app. However, I know this worked before, but suddenly I am getting the error “htmlfile: Unexpected call to method or property access.” in jquery-1.5.1.min.js when the following script is run:
$("#PhoneListDrops").bind('change', function () { var name = $("#PhoneListDrops > option:selected").attr("value"); var label = $("#PhoneTypeAgentLabel"); if (name == 'ACD') { $.getJSON ("/Connections/GetAgentSup", function (newdata, sel) { var newitems = ''; $.each(newdata, function (z, agents) { var selected = ''; if (agents.Selected) { selected = ' checked="checked" '; } newitems += "<input type='radio' name='Sup_Agent' value='" + agents.Value + "' " + selected + " />" + agents.Text; }); // end for each $("#PhoneTypeAgent").html(newitems); }); // end phonelistdrops change label.show(); } // end if = ACD else { // we need to force a blank into the radio button if they select, then unselect ACD var newitems = ''; newitems += "<input type='radio' name='Sup_Agent' value='' />"; $("#PhoneTypeAgent").html(newitems); label.hide(); } });If I comment out the newitems line so it doesn’t try to create the radio buttons, the script no longer generates the error. This only occurs when using IE 8. I have run in Google Chrome (which shows no html errors) and Firefox and the code runs fine and the radio buttons are rendered as they should be.
Any ideas on what might be causing this and how I might fix it?