Support #1845


LogConfiguration error in Firefox on asynchronous callback

Added by Martynas Jusevicius almost 11 years ago. Updated almost 11 years ago.

Start date:
Due date:
% Done:


Estimated time:


I was trying to handle callback from jQuery.ajax() asynchronous HTTP request in Saxon-CE.

I used the technique described by Philip here:

The code:

<script type="text/javascript">	    
var baseUri = 'http://localhost:8080/semantic-reports/';
function loadTypeaheadXML(query)
    var searchUri = UriBuilder.fromUri(baseUri).
	queryParam('query', query).
    $.ajax({url: searchUri,
	headers: { 'Accept': 'application/rdf+xml', 'Authorization': 'Basic XXXXXXXXXXXXXXXXXXXXXXXX=' }
    done(function(data, textStatus, jqXHR)
	ontypeaheadCallback(); // expected to invoke "ixsl:ontypeaheadCallback" template
    } ).
    fail(function(jqXHR, textStatus, errorThrown)
    <xsl:template match="input[contains(@class, 'resource-typeahead')]" mode="ixsl:onkeyup">
	<xsl:call-template name="load-typeahead-xml">
	    <xsl:with-param name="query" select="@prop:value"/>
    <xsl:template name="load-typeahead-xml">
	<xsl:param name="query" as="xs:string"/>
	<xsl:value-of select="ixsl:call(ixsl:window(), 'loadTypeaheadXML', $query)"/>

    <xsl:template match="ixsl:window()" mode="ixsl:ontypeaheadCallback">

When typing into input with @class 'resource-typeahead', Chrome asynchronously logs "INFO: CALLBACK!", as expected.

Firefox 22.0 throws an error instead: 16:37:49.707
SEVERE: (TypeError) 
 fileName: http://localhost:8080/semantic-reports/static/js/saxon-ce/7FFD07C49946B3F4B1DE49E72F7E85FA.cache.html
 stack: Mr@http://localhost:8080/semantic-reports/static/js/saxon-ce/7FFD07C49946B3F4B1DE49E72F7E85FA.cache.html:1685

 lineNumber: 1685
 columnNumber: 324: a is undefined
Line 876


firefox.xsl (836 Bytes) firefox.xsl Martynas Jusevicius, 2013-07-23 16:00
saxonce.html (1 KB) saxonce.html Martynas Jusevicius, 2013-07-23 16:00
typeahead.xml (85 Bytes) typeahead.xml Martynas Jusevicius, 2013-07-23 16:00
Actions #1

Updated by O'Neil Delpratt almost 11 years ago

Hi Martynas,

Thanks for reporting the problem you have found and sorry for delay in responding to this bug issue. We are looking at it now.

Actions #2

Updated by O'Neil Delpratt almost 11 years ago

Hi Martynas,

Please may you send me your files. Either on this bug issue or privately.


Actions #3

Updated by Martynas Jusevicius almost 11 years ago

Sorry, my initial sample wasn't that great. I'm attaching files of what I think is a minimal example. Still works in Chrome but gives TypeError in Firefox 22.0.

Actions #4

Updated by O'Neil Delpratt almost 11 years ago

Thanks. Shortly after sending you the request for code I managed to reproduce the error and I am now investigating it.

Actions #5

Updated by O'Neil Delpratt almost 11 years ago

  • Status changed from New to Rejected
  • Assignee set to O'Neil Delpratt

Hi Martynas,

I managed to get the application to work in Firefox. There is an underlying incompatibility between the browsers when it comes to event accessing. The difference is in how the event object is supplied to the function. In Firefox the event is supplied as a function parameter, whereas in other browsers we access the object via the window object, i.e. window.event@. More information is available at

In Saxon-CE, we facilitate for this problem by providing the function ixsl:event() and others which can be used as an argument in the callback. The documentation gives details of functions available when handling client system functions (See!coding/system-events)

The following change to the template load-typeahead-xml seems to work, here we get access to the event object and pass it to the JavaScript function:

    <xsl:template name="load-typeahead-xml">
    <xsl:param name="query" as="xs:string"/>
    <xsl:variable name="eventi" select="ixsl:event()" />
    <xsl:value-of select="ixsl:call(ixsl:window(), 'loadTypeaheadXML', $eventi, $query)"/>

You also need to modify your JavaScript code to pass the event object in the ontypeaheadCallback call:

function loadTypeaheadXML(event, query)
    ontypeaheadCallback(event); // expected to invoke "ixsl:ontypeaheadCallback" template
Actions #6

Updated by O'Neil Delpratt almost 11 years ago

  • Tracker changed from Bug to Support
  • Status changed from Rejected to Resolved
  • % Done changed from 0 to 100

Please register to edit this issue

Also available in: Atom PDF