jQuery crashing Safari 2

I thought I’d write a specific entry concerning jQuery and Safari 2. Others may be wondering why Safari 2 is crashing when trying to run some elements of jQuery. In a recent project I need to write simple caption strings into a <p> paragraph and was using html().

I first assumed that one of the fade transitions was causing problems (that’s another story!). I eventually narrowed down the problem and found that html() was causing Safari 2.0.4 to crash. In this case it was easy enough to switch to text() to write in the string and that solved it!

jQuery 1.2.6 html() will crash Safari 2.0.4

Here’s the line that caused Safari 2 to crash:

$('#main_image .caption').html(caption).fadeIn();

And the solution:

$('#main_image .caption').text(caption).fadeIn();

Apparently this may be a regression as this error existed on an earlier version of jQuery.

 

5 Responses to “jQuery crashing Safari 2”

  1. paul Says:

    Interesting. Turns out that wrapping the html content in a span tag can stop the crash. Posted by Louis on the jQuery Google group.

  2. leo Says:

    Hi doing a search online for Jquery gallery i came across you nice design code.

    I am a totall beginner and trying t understand. i have sent up my website with the following plugin ( http://blog.themeforest.net/tutorials/create-a-funky-parallax-background-effect-using-jquery/ )

    how and where shall i put your code lets say on “box2″ ?? i know how to put the pictures on the code etc.. but i am having problem to put the gallery and the container expand correctly.

    would be greatful if you could help me with this tks.

    leo

  3. Nadia Laszlo Says:

    To begin with, this is a nice blog site you have right here. I stumbled upon your web site while executing a search on google. Terrific post, I will probably bookmark it for future reading.

  4. Leonel Crisco Says:

    Hey, Great article - keep it coming.

  5. PITTSTIFFANY Says:

    Houses are not very cheap and not every person can buy it. However, personal loans are invented to help different people in such cases.

Leave a Reply