[jQuery] Re: $.getScript in Firefox 3
Actually, scratch that - it seems to be working now. I'd still appreciate a comment from a jQuery guru on the original problem I've worked around here! Mark.
[jQuery] Re: $.getScript in Firefox 3
Hmm, actually I think I'm still getting the problem, it's just being quiet about it now :( On Sep 16, 3:00 pm, Mark T <[EMAIL PROTECTED]> wrote: > Ok, my temporary fix has been to alter the following block of code > from line 2656 in jquery 1.2.6: > > // If we're requesting a remote document > // and trying to load JSON or Script with a GET > if ( s.dataType == "script" && type == "GET"){ > //&& remote.test(s.url) && > remote.exec(s.url)[1] != location.host ) > { > var head = document.getElementsByTagName("head")[0]; > var script = document.createElement("script"); > > I have commented out the second part of the IF statement which tests > whether the URL is remote. This will force all scripts to use the >
[jQuery] Re: $.getScript in Firefox 3
Ok, my temporary fix has been to alter the following block of code from line 2656 in jquery 1.2.6: // If we're requesting a remote document // and trying to load JSON or Script with a GET if ( s.dataType == "script" && type == "GET"){ //&& remote.test(s.url) && remote.exec(s.url)[1] != location.host ) { var head = document.getElementsByTagName("head")[0]; var script = document.createElement("script"); I have commented out the second part of the IF statement which tests whether the URL is remote. This will force all scripts to use the
[jQuery] Re: $.getScript in Firefox 3
I'm getting even more convinced that this is an issue with FF3 & jQuery. Interestingly, it only affects local JS files, which are inserted as text into the head of the document between script tags. Remote files, which are loaded using
[jQuery] onClick prepend
I am trying to make the on-click event of any element optional depending on what the user decides. The only functions I see out there append a function to the on-click event. I have played with the browser bubbling / catching stuff too. That worked in Firefox but not in IE 7. It seems I can't access the on-click function if it was defined within the element's onclick="" attribute. Here are my two approaches. Tell me if you have a better idea. 1) eval() // I guess IE doesn't like us using this. Firefox doesn't care. $(document).ready(function() { var onClickAttr = $('#clickTester').attr('onclick'); $('#clickTester').removeAttr('onclick').click(function(){ if (confirm('Perform Original Action?')) { eval(onClickAttr); } } }); 2) Bubbling // Again, IE problems while Firefox works just fine. $(document).ready(function() { var $span = $('<span></span>').attr('onclick', $('#clickTester').attr('onclick')); $('#clickTester').removeAttr('onclick').wrap($span); $('#clickTester').click(function(event){ if (!confirm('Perform Original Action?')) { event.stopPropagation(); } }); });