I have a VF page which is part of a customer portal. This page displays records from custom object in a Apex:DataTable. I have added pagination with Prev,Next,First,Last links to enable users to navigate through records.

The data is obtained by a SOQL query using the latest OFFSET feature. Everything is fine with this.

I did most of the development in Firefox as I love the CSS and dev tools it has. Everything worked fine. I tested in Chrome and it was fine. Last was IE9 which defying logic is still the most popular browser out there.

IE displays the page well. But has major issues with the pagination functionality. Clicking the Prev, Next buttons will work for maybe 5-8 clicks and then it starts freezing up and finally stops working altogether. Since the table has to be re-rendered, I knew this has to be the dreaded AJAX issues that VF seems to have with IE9.

I tried this again with the Javascript console and sure enough when it froze, I got this error.

SCRIPT87: Invalid argument. 
3_3_3.Finalorg.ajax4jsf.javascript.AjaxScript?rel=1359595794000, line 146 character 96


I tried searching online and found a few similar posts addressing the AJAX refresh issue.

None of this seems to help. Running in IE7,IE8 compatibility also does not seem to help.

The Apex:form is within the <body> tag.

These solutions may or may not help you. They did not work for me.



AJAX communication on visualforce > Internet Explorer 8/9 issues

How can I resolve this issue as this is required to work properly on IE9. Please let me know if you need other information from me.

Thank you very much in advance.


Actually I found the solution finally.

Thanks to this guy's post in the developer forums. http://boards.developerforce.com/t5/Visualforce-Development/actionFunction-causing-Javascript-error-when-using-oncomplete-or/m-p/193724#M25961

The key was to override the Javascript function in question and add a try/catch block to ensure IE does not terminate the running code.

A4J.AJAX.XMLHttpRequest.prototype._copyAttribute = function (src, dst, attr) {
var value = src.getAttribute(attr);
if (value) {
    try {
        dst.setAttribute(attr, value);
    } catch (err) {
        //alert('Error with Salesforce: ' + err.description + '\nattr: ' + attr + '\n');


I hope this helps someone who runs into this same issue with IE9.

  • 1
    Good find. You can mark your own answer as the answer to the question by the way. You should probably do that in this case. It will make it easier for people down the road to find the right answer. – Jesse Altman Jan 31 '13 at 18:49
  • Yes thank you. I will mark it as the answer. Looks like we need to wait 2 days for this. – Richard N Jan 31 '13 at 19:11
  • How can we use <apex:actionFuncton /> onComplete attribute with the above implementation. – zuke Feb 11 '14 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.