Posts

Showing posts with the label firefox

FCKeditor v2.4.3 Firefox "script stack space quota is exhausted" fixed !

Hi all, I was uploading a document of about 10 MB doc in FCKeditor v 2.4.3 from server. In IE it works fine but for the Firefox v>2.0 , I was getting this strange bug "script stack space quota is exhausted" . Thought it was inherent firefox problem , But why did FCKeditor caused it ? After reading the code and having some inline tests , I found that the following code in fckeditorcode_ie.js FCKeditor start function caused this problem, /* Buggy regex match for body contents*/ /* Results in "script stack space quota is exhausted" for large documents*/ var G=A.match(FCKRegexLib.BeforeBody); var H=A.match(FCKRegexLib.AfterBody); if (G&&H){ var I=A.substr(G[1].length,A.length-G[1].length-H[1].length); A=G[1]+' '+H[1]; if (FCKBrowserInfo.IsGecko&&(I.length==0||FCKRegexLib.EmptyParagraph.test(I))) I=' '; this._BodyHTML=I; }else this._BodyHTML=A; };...

Detecting browser event closing in Javascript

I've been working on a feature where the user must be prompted to take up certain action when he leaves a page by closing the browser window or by clicking an external URL,though I searched for the best possible solution but unfortunately couldn't find one. The first thing that got my attention is the browser's "onbeforeunload" event and here is the implementation of it, window.onbeforeunload=confirmExit; function confirmExit(){ return "Do u want to close this page?" } So here the user will be prompted when he clicks the close button of the browser and when the user clicks "cancel" in prompt, it stays the same page.So far works fine. When testing is on the way , suddenly problems getting piled up and I need to reconsider the solution above, since the requirement is to "prompt the user only when he leaves the current domain (website)" and here for the above code, the user is prompted whenever...