Loading ...
Sorry, an error occurred while loading the content.

Re: best way to teach jslint that I know about the "circular dependencies"

Expand Messages
  • DoNotSay
    Douglas, ... gboxJSON2( /swapbild ,{ von :$j(this).attr( id ), nach :$j(ui.draggable).attr( id )},function(erg){}); ... It also works with non-global
    Message 1 of 4 , Aug 16, 2008
    • 0 Attachment
      Douglas,

      > > function blddrgable()
      > > {
      > > $j('div.blddrg').draggable("destroy").droppable("destroy");
      > > $j('div.blddrg').draggable({opacity:0.8,zIndex:8000,helper:"clone"})
      > > .droppable({accept:'.blddrg',drop:onDropBld});
      > > }
      > >
      > > function onDropBld (e, ui){
      >
      gboxJSON2("/swapbild",{"von":$j(this).attr("id"),"nach":$j(ui.draggable).attr("id")},function(erg){});
      > > $j(this).swap($j(ui.draggable));
      > > blddrgable();
      > > }
      > >
      > > "blddrgable()" connects function "onDropBld" to the drop-event of some
      > > .divs. That function does some stuff, and after doing it, it calls
      > The global trick obviously only works if the functions are global.

      It also works with non-global functions, but is an ugly, ugly hack!

      > Ideally, you should have no more than one global function, so it is
      > not a general solution.
      yes. And I am workung hard on restructuring my .js to do exactly that!
      your jslint is of GREAT value and a really really big time saver.

      > 1) Make gboxJSON2 an inner function of blddrgable.
      gboxJSON2 is allready defined outside, so making it inner won't do any
      good.

      > 2) var gboxJSON2;
      > function blddrgable...

      That would be...
      var gboxJSON2;
      function bllddrgabl ... ondrop:onDropBld

      onDropBld=function...

      Is there any price to pay for this declaration? IF yes, which price?

      best wishes,

      Harald
    • Douglas Crockford
      ... It is insignificant.
      Message 2 of 4 , Aug 16, 2008
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "DoNotSay" <arminx@...> wrote:
        > Is there any price to pay for this declaration? IF yes, which price?

        It is insignificant.
      Your message has been successfully submitted and would be delivered to recipients shortly.