Search code examples
javascriptjqueryideoutlineonready

jQuery ready block hiding code outline in IDE


When I write the following code, whether Im using Aptana, Dreamweaver or Eclipse, I can never see functions in the onready block in the outline view:

$(document).ready(function(){
   function myFunction(){
   }
   function myFunction2(){
   }
});

Basically the only thing I see in outline is the onready and I have to remove the onready if I want to see all my functions. What technique or way of handling this situation can I try to both see all the functions in outline view and still use onready?


Solution

  • What technique or way of handling this situation can I try to both see all the functions in outline view and still use onready?

    Just don't define your own functions inside like you demostrated. It's unnecessary. Have your functions defined outside like so:

    function myFunction(){
    
    }
    
    function myFunction2(){
    
    }
    
    $(document).ready(function() {
        myFunction();
        myFunction2();    
    
    });