I think I ran into something that probably might be **over* usag of
jQuery.  It may mean I need recognize a few things, but I naturally
thought jQuery should be able to handle this.

Ok I have been creating autonomous "modules" and each can load by
themselves.

Now, I've been loading a few of them on a page and now things behave
alittle different than when they run by themselves.

Example:

    $('#winserver_pane1').load('/code/jqApplet1.wcx');
    $('#winserver_pane2').load('/code/jqApplet2.wcx');
    $('#winserver_pane3').load('/code/jqApplet3.wcx');

Each of the URLs  /code/jqAppler1 2 and 3.wcx  runs fine when used and
loaded by themselves and each is using jQuery, specifically
jquery.cluetip.

But when loaded together like above to show three different views on
the same page, the 2nd and 3rd applet are not behaving as expected.

I think it is because I have been using document.ready to initialize
each, but when they are lump together,  it "appears" only the first
one is initialized.

Does that sound right?  I'm sure I am missing something here that
appears to be so "basic" and par for the course with jQuery - people
loading multiple ajax views.

Each has basically this to initialized itself:

$(document).ready(function() {
  $('a.basic').cluetip({
         width: '450px',
         arrows:true,
         dropShadow: false,
         waitImage: '/public/js/wait.gif'
    });
});

Most notably is the waitImage location, and other attributes that are
initialized under document.ready are not longer correct.  The first
view will find the image, the 2nd and 3rd will not, so I suspect that
it wasn't set.

But what I don't understand is if its not initializing again or
"merging it" as I logically expected, shouldn't atleast the 2nd and
3rd loading inherit the first initialization? or are they suppose to
be under different jQuery scopes?

I guess maybe I was treated it as they were under different scopes but
maybe thats not possible.

Thanks in advance.

--
HLS

Reply via email to