Anyone? I was looking forward to using jQuery in the extension but I might have to do without... :[
On Fri, Jan 16, 2009 at 3:47 PM, Nic Luciano <nic.luci...@gmail.com> wrote: > Hm, that makes sense. So, I suppose I could do something like.... > > jQuery.noConflict(); > var doc = window.content.document; > jQuery("#id", doc); > > Which would solve the issue that jQuery doesn't live in the HTML anymore > (and lives in the browser). But how would this work on .ajax functions? Do I > have to edit the instantiation/references in the first couple lines of > jQuery to point somewhere other than window? Or will functions like .ajax > (that don't browse the DOM) only work when there is a document to access (as > opposed to on load of Firefox)? > > Thanks- > > > On Fri, Jan 16, 2009 at 9:29 AM, Eric Garside <gars...@gmail.com> wrote: > >> >> I'm pretty sure the problem is that jQuery is defining itself in it's >> header section as something like window.jQuery = jQuery = $ or some >> such referential transitive equation strand. I'm not an expert at FF >> plugins, but I have gone through the motions of building one that >> modified current pages only. And to get to that page, you had to >> invoke a special call to get access to the current tabs current page >> html. >> >> I'd look into that, and get to the point where you can alert the >> innerHTML of a page element. That's how I first started to learn it. I >> just wish I hadn't already forgotten. :P >> >> On Jan 15, 11:37 pm, Nic <nic.luci...@gmail.com> wrote: >> > It seems like this has been asked a million times, but nothing seems >> > to answer my question. >> > >> > I include it in my .xul above my other scripts- (I checked the >> > location and it's correct). >> > >> > It's the first time I've used jQuery in an extension, so I'm trying to >> > run some commands on load just to see if it works. The following below >> > throws no exceptions: >> > >> > window.addEventListener("load", function() { init(); }, false) >> > var init = function() { >> > try { >> > jQuery.noConflict(); >> > } catch(e) { alert(e); } >> > >> > } >> > >> > Below I'll list a bunch of things I tried with their respective errors >> > to maybe help give a glimpse into whats going on... What's going on >> > here? I'm sure it's something obvious, or simple... >> > >> > The following: >> > >> > window.addEventListener("load", function() { init(); }, false) >> > var init = function() { >> > try { >> > jQuery.noConflict(); >> > alert(jQuery("body")); >> > } catch(e) { alert(e); } >> > >> > } >> > >> > Throws: >> > >> > TypeError: n.find is not a function >> > >> > The Following: >> > >> > window.addEventListener("load", function() { init(); }, false) >> > var init = function() { >> > try { >> > $.getJSON("http://www.google.com/", function(data) { >> > alert(data); >> > }); >> > } catch(e) { alert(e); } >> > >> > } >> > >> > Throws: >> > TypeError: $.getJSON is not a function >> > >> > The Following: >> > >> > window.addEventListener("load", function() { init(); }, false) >> > var init = function() { >> > try { >> > jQuery.noConflict(); >> > jQuery.getJSON("http://www.google.com/", function(data) >> { >> > alert(data); >> > }); >> > } catch(e) { alert(e); }} >> > >> > Throws: >> > TypeError: jQuery.getJSON is not a function >> > >> > Thanks, guys! >> > >