4

I am retrieving data from an XML file, and then using the jQuery .find() function to access that data. However in Firefox (version 37.0.2) I am getting the following errors in the JavaScript console:

Error: Unable to run script because scripts are blocked internally.
Error: not well-formed
Source Code:
<datarecord><div><a id='sizzle1430853521804'></a><select id='sizzle1430853521804- ]' msallowcapture=''><option selected=''></option></select></

Everything still works ok, but does anyone know how I can get rid of this error, or is it a bug in Firefox?

Here is my code:

$.ajax({
  url:"file.xml", 
  type:"GET", 
  dataType:"xml", 
  success:function(xml){
    $(xml).find("field_id").each(function(){
      // my code...
    }
  }
});

The XML file is of the following format and I have used an XML validator to make sure it is ok:

<?xml version="1.0" encoding="utf-8"?>
<datarecord>
<field_id><TheIdValue>8</TheIdValue><TheDisplayValue>Joe Bloggs</TheDisplayValue></field_id>
etc...
</datarecord>

I have not been able to find a solution. Any suggestions?

Stevio
  • 383
  • 3
  • 12

1 Answers1

6

I can't say for sure that it will fix your problem, but I had similar issues with the 'not well-formed' message in firefox. Turns out there is a bug in jQuery 1.11.2 and 1.11.3 - https://github.com/jquery/jquery/issues/1969 - which is fixed upstream.

It's a relatively minor change if you host jquery on your server - see the github commit

on jquery.1.11.3.js line cca 1197 (in QSA/matchesSelector section):

 -              "<select id='" + expando + "-\f]' msallowcapture=''>" +
 +              "<select id='" + expando + "-\r\\' msallowcapture=''>" +

Hopefully there will be a new release soon.

aland
  • 1,824
  • 2
  • 26
  • 43
  • 1
    Thanks, I made that change and it fixed the bug! The error did not actually seem to stop my code from working but good to have it fixed. – Stevio Nov 30 '15 at 14:20