Weird random behaviour in Safari (and possible other browsers too)

Weird random behaviour in Safari (and possible other browsers too)

I have been trying to find a solution for this for a couple of months now, but still haven't been able to find out what's wrong, so if someone could help me out I will be forever greatful!

Problem is I have a (rather complex) web page with lots of jquery javascript. It works perfectly about 50% of the time. The other times it will display parts of javascript code printed in the web page or parts of html tags in clear text. It never happens if I turn Javascript off, so my best guess is that jquery for some reason messes up the page or loads things through ajax in random places.

It happens very often when running Safari, I have seen it once or twice in Firefox too, but not nearly as often. When checking the page's source code it all looks right.

Can anyone help me figure out what goes on? This is a link to a page where it happens quite often:
http://www.styrketraning.org/members/image-album.php?member=viktor&album_id=2 (I also uploaded a screenshot)