Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

where to put document.ready Js functions?

edited August 2012 in Vanilla 2.0 - 2.8

I am really lost on this one. I'm a noob in the world of Vanilla. I read all Docs. Browsed the Dev forum and even the community wiki. Also is there a comprehensive list of functions, methods, classes, obj etc.? I am slowly but surely wrapping my head around this. My intuition tells me I like it. Thanks in advance.

Comments

  • Options
    KasperKasper Scholar of the Bits Copenhagen Vanilla Staff

    Like:

    jQuery(document).ready(function() {
        ...
    });
    

    ...or?

    Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub

  • Options

    Thank you sir. I was forgetting the jQuery ?method? . I get all the logic but my vocabulary is weak as all my training comes from reading code not textbooks. I am assuming 'jQuerry()' is a method.

  • Options
    peregrineperegrine MVP
    edited August 2012

    kasper is correct you can wrap everything in that

    Your other question

    http://www.vanilla-wiki.info/vdocs/

    jquery inclusion - here

    http://vanillawiki.homebrewforums.net/index.php/Main_Page

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    thanks guys :)

  • Options

    @SonicNebula

    yes ready is a method. http://api.jquery.com/ready/

    I would change it to

    jQuery(document).ready(function() {

    jQuery(document).ready(function($) {

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    peregrineperegrine MVP
    edited August 2012

    @SonicNebula

    yes ready is a method. http://api.jquery.com/ready/

    Both below will work, but the second option will ensure less potential problems.
    Suggestion, I would change it from

    jQuery(document).ready(function() {
    
    // put your functions here
    
    });
    to
    
    jQuery(document).ready(function($) {
    
    // put your functions here
    
    });
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.