views:

170

answers:

1
    $("#table_exams tbody tr").click(function (event)
        {
            window.location.href="#" +$(this).attr("exam_ID");      
            window.location.href="/medilab/prototypes/exams/edit?examId=" + $(this).attr("exam_ID") +"&referer=" + referer;     
            row_select(this);
        });

 $(document).keypress(function (event) {
            if(event.keyCode==13) $(row_selected).trigger("click");

        });

I have a little problem with this only in chrome...When user goes back chrome ignores the last href hash that my script added..but when i do a doubleclick its ok... IE and Firefox work great...

+1  A: 

I would try location.hash which is a bit more consistent in behavior, like this:

window.location.hash="#" +$(this).attr("exam_ID");      
window.location.href="/medilab/prototypes/exams/edit?examId=" + $(this).attr("exam_ID") +"&referer=" + referer;     

Chrome tends to optimize the callstack, it's tracing engine knows the location.href is only set in a way that results in an action in the last set...this prevents that tracing optimization from happening (jQuery has similar issues here, there's specific code in the Sizzle engine to cope with the fact Chrome does this).

Nick Craver
before using location.href it was location.hash but it had the same problem:(
Parhs
@Parhs - I thought this would be fixed by now, since the same issue affects gmail (`#inbox` bug), but looks like it's still open. Sorry it's not good news...but something the chrome team needs to fix: http://code.google.com/p/chromium/issues/detail?id=1016
Nick Craver