I see, I misunderstood what your original question. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> $.fn.justATest = function () { alert("inside justATest"); }; $("body").justATest(); </script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> $("body").justATest(); </script>
You are correct, the second one will overwrite the first. What are you trying to solve by loading the jquery script twice? Maybe there's a better solution. JK -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of aakoch Sent: Thursday, December 04, 2008 2:18 PM To: jQuery Development Subject: [jquery-dev] Re: Overwriting plugin functions - bug or feature? Easy enough for me to whip one up: http://www.adamkoch.com/jQueryTest.html On Dec 4, 4:07 pm, "Jeffrey Kretz" <[EMAIL PROTECTED]> wrote: > This shouldn't be happening. > > Do you have a test case page we could take a look at? > > JK > > -----Original Message----- > From: [email protected] [mailto:[EMAIL PROTECTED] On > > Behalf Of aakoch > Sent: Thursday, December 04, 2008 1:30 PM > To: jQuery Development > Subject: [jquery-dev] Overwriting plugin functions - bug or feature? > > My co-worker and I found a bug/feature and wanted to get some feedback > as to the thought behind this "feature". > > Situation: On a single page I'm using jQuery via the script tag, then > I add a custom function, and finally I call jQuery again via the > script tag. When I try to run my custom function, it's gone! It seems > that although jQuery will try to use any previously created jQuery > object, jQuery.fn is overwritten every time. > > // don't recreate jQuery > var jQuery = window.jQuery = window.$ = function( selector, context ) > { ... > ... > // but always overwrite the functions? > jQuery.fn = jQuery.prototype = {... > ... > > Is there a reason that jQuery.fn is being overwritten? > > Thanks, > Adam --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---
