SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Dec 2009
    Posts
    302
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    need help in a jquery and javascript call

    This is my html . the onload function calls a javascript function.

    How to run a Jquery after the Javascript function calls ?


    html
    -----
    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="onLoadSettings()">

    </body>


    javascript calls
    ---------------

    function onLoadSettings() {

    calculateGrandTotal(); //defined somewhere
    calculatePrevYearGrandTotal(); //defined somewhere
    calculateAcceptTotal();//defined somewhere


    // L1 <---I want to run the Jquery code here .

    }



    JQuery

    I have written a Jquery code as below

    <script type="text/javascript">
    $(document).ready(function(){
    // some JQuery code here
    });

    </script>


    I want to run this JQuery piece of code in the L1 place .

    Could you please give me some idea ?

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I dont see why you would wouldn't add a call to your custom function within the jquery $(document).ready call, that way when the document is ready your onLoadSettings function would run before all images have loaded etc.

    If thats not what you want to do, why not simply add the jquery content to the insides of the onLoadSettings function...

    This function is running on page load anyway so there is no point in running a jquery $(document).ready.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •