[How To - Lazy load] Refresh page (F5) in Firefox

[How To - Lazy load] Refresh page (F5) in Firefox

  
Forge Component
(16)
Published on 2014-07-15 by Francisco Menezes
16 votes
Published on 2014-07-15 by Francisco Menezes
Hi,

I'm currently implementing the lazy load functionality on one of my web pages. It works great and really adds value to the performance!

But I'm afraid I found a small bug. If I load the testpage in Firefox (v 38.0.5), it works fine. If I then press F5 (after all the Lazy Load is finished), I get an error in the javascript console and my page gets stuck (see attachment).

This is the error:

TypeError: osAjaxBackend is null
Stack trace:
OsEndRequest@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:5:4692
@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval line 18 > eval:2:1
window.outsystems.internal.jQueryFactory/</<.globalEval/<@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:18:13993
window.outsystems.internal.jQueryFactory/</<.globalEval@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:18:13967
OsEvaluateUserJavaScript@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:5:11838
OsExecuteJSONUpdate@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:5:13625
OsJSONUpdate@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:5:10663
@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval line 18 > eval:2:1
window.outsystems.internal.jQueryFactory/</<.globalEval/<@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:18:13993
window.outsystems.internal.jQueryFactory/</<.globalEval@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:18:13967
window.outsystems.internal.jQueryFactory/</<.domManip/<@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:25:23865
window.outsystems.internal.jQueryFactory/</<.each@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:18:14397
window.outsystems.internal.jQueryFactory/</<.domManip@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:25:23730
window.outsystems.internal.jQueryFactory/</<.append@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:25:21008
window.outsystems.internal.jQueryFactory/</<.html/<@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:25:22677
window.outsystems.internal.jQueryFactory/</<.access@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:18:15853
window.outsystems.internal.jQueryFactory/</<.html@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:25:22243
OsAjaxBaseBackend/this.ShowError@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:65:8729
OsAjaxBackendXHR/XHRState/this.ProcessFinalResponse@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:65:16410
OsAjaxBackendXHR/this.SubmitForm/e@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:65:13992
window.outsystems.internal.jQueryFactory/</$.Callbacks/l@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:18:16833
window.outsystems.internal.jQueryFactory/</$.Callbacks/m.fireWith@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:18:17618
d@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:26:3442
window.outsystems.internal.jQueryFactory/</</<.send/d@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:26:9007
 _osjs.js:5:12424
 
"OsEndRequest@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:5:4692
@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval line 18 > eval:2:1
window.outsystems.internal.jQueryFactory/</<.globalEval/<@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:18:13993
window.outsystems.internal.jQueryFactory/</<.globalEval@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:18:13967
OsEvaluateUserJavaScript@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:5:11838
OsExecuteJSONUpdate@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:5:13625
OsJSONUpdate@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:5:10663
@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval line 18 > eval:2:1
window.outsystems.internal.jQueryFactory/</<.globalEval/<@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:18:13993
window.outsystems.internal.jQueryFactory/</<.globalEval@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:18:13967
window.outsystems.internal.jQueryFactory/</<.domManip/<@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:25:23865
window.outsystems.internal.jQueryFactory/</<.each@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:18:14397
window.outsystems.internal.jQueryFactory/</<.domManip@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:25:23730
window.outsystems.internal.jQueryFactory/</<.append@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:25:21008
window.outsystems.internal.jQueryFactory/</<.html/<@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:25:22677
window.outsystems.internal.jQueryFactory/</<.access@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:18:15853
window.outsystems.internal.jQueryFactory/</<.html@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:25:22243
OsAjaxBaseBackend/this.ShowError@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:65:8729
OsAjaxBackendXHR/XHRState/this.ProcessFinalResponse@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:65:16410
OsAjaxBackendXHR/this.SubmitForm/e@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:65:13992
window.outsystems.internal.jQueryFactory/</$.Callbacks/l@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:18:16833
window.outsystems.internal.jQueryFactory/</$.Callbacks/m.fireWith@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:18:17618
d@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:26:3442
window.outsystems.internal.jQueryFactory/</</<.send/d@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:26:9007
" _osjs.js:5:12457
 
not well-formed _osjs.js:1:1
GET 
http://osdev01.dev/EricaLazyLoad/null [HTTP/1.1 404 Not Found 2ms]
GET 
http://osdev01.dev/RichWidgets/null [HTTP/1.1 404 Not Found 3ms]
TypeError: osAjaxBackend is null
Stack trace:
@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval line 18 > eval:2:1
window.outsystems.internal.jQueryFactory/</<.globalEval/<@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:18:13993
window.outsystems.internal.jQueryFactory/</<.globalEval@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:18:13967
OsEvaluateUserJavaScript@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:5:11838
OsExecuteJSONUpdate@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:5:13625
OsJSONUpdate@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:5:10663
OsAjaxBackendXHR/this.EndRequest@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:65:14614
OsAjaxBaseBackend/this.EndRequestAndCancelPendingRequests@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:65:9257
OsAjaxBaseBackend/this.ShowError@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:65:8767
OsAjaxBackendXHR/XHRState/this.ProcessFinalResponse@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:65:16410
OsAjaxBackendXHR/this.SubmitForm/e@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:65:13992
window.outsystems.internal.jQueryFactory/</$.Callbacks/l@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:18:16833
window.outsystems.internal.jQueryFactory/</$.Callbacks/m.fireWith@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:18:17618
d@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:26:3442
window.outsystems.internal.jQueryFactory/</</<.send/d@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:26:9007
 _osjs.js:5:12424
 
"@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval line 18 > eval:2:1
window.outsystems.internal.jQueryFactory/</<.globalEval/<@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:18:13993
window.outsystems.internal.jQueryFactory/</<.globalEval@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:18:13967
OsEvaluateUserJavaScript@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:5:11838
OsExecuteJSONUpdate@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:5:13625
OsJSONUpdate@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36 line 18 > eval:5:10663
OsAjaxBackendXHR/this.EndRequest@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:65:14614
OsAjaxBaseBackend/this.EndRequestAndCancelPendingRequests@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:65:9257
OsAjaxBaseBackend/this.ShowError@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:65:8767
OsAjaxBackendXHR/XHRState/this.ProcessFinalResponse@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:65:16410
OsAjaxBackendXHR/this.SubmitForm/e@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:65:13992
window.outsystems.internal.jQueryFactory/</$.Callbacks/l@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:18:16833
window.outsystems.internal.jQueryFactory/</$.Callbacks/m.fireWith@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:18:17618
d@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:26:3442
window.outsystems.internal.jQueryFactory/</</<.send/d@http://osdev01.dev/EricaLazyLoad/_osjs.js?9_0_0_36:26:9007


The platform we use is Java.

To be honest I'm not really sure where to start debugging :)
Hope you can help me with this!

Thank you,
Erica
I have found the solution to this problem.

The problem is when you click F5 in Firefox, Firefox remembers the viewstate without the RefreshLink (since it is in the False node of the if-statement, and not on the screen anymore). Therefore it cannot find the link after pressing F5 and throws an error.
To fix this, just move the Refreshlink and script-expression out of the if-statement. Since it has style display:none it does not effect your screen.
Hi Erica,

Excelent solution! Thank you very much :)