Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Friends,

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

SCREENSHOT HERE: http://i47.tinypic.com/14avtjq.png

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.

http://success.salesforce.com/issues_view?id=a1p30000000RduwAAC

http://boards.developerforce.com/t5/Visualforce-Development/IE9-rerender-and-iframes-don-t-work/td-p/260459

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.

share|improve this question

1 Answer 1

up vote 8 down vote accepted

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.

share|improve this answer
    
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 at 9:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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