jqSOAPClient and Firefox truncating XML Response

So I was trying to figure out why my little Stock Ticker control was never getting any results. It was implemented inside of a SharePoint 2007 site using jQuery and jqSOAPClient. I had to use the SOAP stuff to integrate with the standard web services provided by SharePoint.

So I created this service and everything was working great, until one day Firefox just decides to totally break and not show the Stock Ticker information. Since I was not having this problem in any other browser I was a little skeptical that I had some major bug in the code, but rather there was some browser peculiarity that was causing the issue.

Long story short, there was, and I found an identification of the cause here: http://www.coderholic.com/firefox-4k-xml-node-limit/.

So now what to do? Well fix it of course…

So the trick was to use the fix that was detailed on the Coderholic blog and insert it in the right place, in the jqXMLUtils file around line 55 there is a case statement, case 3, where I inserted the code from the Coderholic blog.

?View Code JAVASCRIPT
...
case 3: //Text Value
    var resultText;
    if(typeof(cnode.parentNode.textContent) != "undefined") 
    {
         resultText = cnode.parentNode.textContent;
    }
    else     
    {
         resultText = cnode.nodeValue;
    }
 
    obj.Text = $.trim(resultText);
    break;
...

Looking through the code, there is probably something else that should be done with the CData elements as well identified in case 4, but for my purposes this is sufficient.

Source: jqXMLUtils.js

Posted on September 28, 2011 at 10:30 pm by jrickard · Permalink
In: Programming · Tagged with: , ,

Leave a Reply

*