sammy icon indicating copy to clipboard operation
sammy copied to clipboard

href="javascript:;" crash sammy under IE8

Open TeRq opened this issue 13 years ago • 8 comments

using: (https://github.com/quirkey/sammy/raw/master/examples/hello_world/index.html) with jquery: (http://code.jquery.com/jquery-1.5.1.min.js) sammy: (https://github.com/quirkey/sammy/raw/master/lib/sammy.js)

I've added break sammy

like: break sammy

sammy works fine until i click "break sammy" link. The hash changes on location bar but content doesn't change.

TeRq avatar Mar 21 '11 12:03 TeRq

Working workaround: // fix sammy in IE if ($.browser.msie) { $("a[href='javascript:;']").livequery("click", function() { return false; }); }

TeRq avatar Mar 22 '11 10:03 TeRq

Does the back button still work in this scenario? What if you change the URL back to #/test by hand - does it update the onscreen text?

quirkey avatar Mar 27 '11 17:03 quirkey

Back button wont work, hand change wont work to.

TeRq avatar Mar 28 '11 21:03 TeRq

Hi guys,

I understand this is a browser issue (on of many of IE). But as I see it, you either accept this as a bug, or no longer claim sammyjs supports IE8 (at least not fully).

Cheers

gabrys avatar Mar 30 '11 08:03 gabrys

Have you tested it @gabrys? There are a lot of things that could be going on here and I havent had time to fully test yet. One - I havent tested Sammy + jQuery 1.5.1. Two - I havent tested this combination in IE yet. Three - What situation do you have that sort of link in a web application? Sammy will also stop working in any browser if you do <a href="javascript: Sammy().unload();"> but that doesn't mean Sammy doesn't support every major browser.

quirkey avatar Mar 30 '11 16:03 quirkey

Not tested is not a reason to close the bug.

The easiest test case: http://www.wikidot.com/sammy.php

It's one of the examples from Sammy's repo with a bunch of links added. Easy to click and see which break Sammy's navigation and which don't.

gabrys avatar Mar 30 '11 18:03 gabrys

Sorry, I did not mean to close the bug - annoying that Githubs comment and close button is the first, I always end up hitting it :/

I will get around to testing this but unsure what the actual issue is/where it lies. Does click that type of link break regular jQuery operations or any setInterval?

quirkey avatar Mar 30 '11 18:03 quirkey

Thank you for the clarification. jQuery stuff seems to work after clicking such link.. For example we're using .live('click', function()...) for some events and they do work even after Sammy breaks. I haven't check setInterval though.

gabrys avatar Mar 30 '11 19:03 gabrys