You'll have to use a separate namespace - jQuery, internally, expects
the 'this' object to refer to itself - and if it's within the context
of another object, it'll probably get confused. (I've never tried this
personally.)

That being said, I like that idea, and it would be cool if jQuery
could do that. If you'd like, you can file a ticket and I can look
into it.
http://dev.jquery.com/

Thanks!

--John

On 7/11/07, Byron <[EMAIL PROTECTED]> wrote:

Hi all,

I've started using jquery in  the development of a firefox extension.
it works pretty well, aside from a few effects not working properly
but that i can deal with (only effects i'll want will be toggle, hide
etc...)

anyway to the point.

generally when developing extensions i like to keep all my properties
and functions etc in one global namespace, im not sure if this is the
best approach but its worked pretty well in the past when it comes to
avoiding namespace collisions.

example :

var myObject = {
  config : {
    debug : true
  },
  init : function () {..}
} ;

now after a bit of thought, i realised someone else might decide to
use jquery in their extension or use $ for somthing else..  then i
thought "No Problem jQuery.noConflict() to the rescue!"

so off I went to try it out;

myObject.$ = jQuery.noConflict();

didnt work...

so then i tried some differnt combinations..

myObject.foo = jQuery.noConflict();

myObject.prototype.$ = jQuery.noConflict();

var jBuf = jQuery.noConflict();
myObject.$ = jBuf;

by now i was getting frustrated (as is probably evident in this
post...)
So is there any way to do it like this or will i have to use a
seperate namespace for jquery?

TIA

Byron


Reply via email to