Chili icon indicating copy to clipboard operation
Chili copied to clipboard

Last lines is cutted in firefox 7

Open developerworks opened this issue 13 years ago • 2 comments

This is the page for the issue:

http://www.hezhiqiang.info/articles/228/titanium-mobile-register-login-page-on-xoom

In firefox 7, the last lines is cutted, and not show in web page, but show correctly in google chrome, i guess the chili 2.2 is not compatiable with firefox's javascript engine.

developerworks avatar Oct 04 '11 17:10 developerworks

Also seeing this issue on http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth.

bcherry avatar Oct 12 '11 06:10 bcherry

I had the same issue and have found a work-around until the issue gets fixed (but it looks like the author and co are no longer interested in this project. Shame because it's a nice highlighter).

Looking at both your examples and my code snippets that break, it appears to be any code ending with a closing bracket has that bracket and semi-colon stripped from the output. So:

$('.rightback').css({ 'background': '#fff' });

produces:

$('.rightback').css({ 'background': '#fff' }

If you follow this with another command that does not have a closing bracket. All is well:

$('.rightback').css({ 'background': '#fff' }); location.href = '#html';

produces the correct output.

If it is not practical to do this, then place a comment as the last line. Even an empty comment will do. Both these work:

$('.rightback').css({ 'background': '#fff' }); /* */

and

$('.rightback').css({ 'background': '#fff' }); /* Some final comment */

This solution is really important for me because when the output result is clicked, the code is executed in real time.

Hope this helps. If anyone knows why Firefox7 does this code stripping then please let me know.

ghost avatar Nov 07 '11 15:11 ghost