SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Dec 2009
    0 Post(s)
    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 ?

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


    javascript calls

    function onLoadSettings() {

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

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



    I have written a Jquery code as below

    <script type="text/javascript">
    // some JQuery code here


    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
    0 Post(s)
    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.


Posting Permissions

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