Solved

Hot to render HTML in function before calling another function?

Posted on 2011-09-06
3
194 Views
Last Modified: 2012-06-27
Hi there,

I've got two functions that depend on each other, it's very long so this is an example of what happens.

2 functions get called during an onclick function, drawTable() and updateTable().

drawTable() basically outputs a table,

so something like this.

table id='mytable1'

then updateTable() appends to the table output so it uses the id mytable1.

$('#mytable1').append("sample");


This works perfectly in IE9 and Firefox. On Chrome there is an issue and the issue is that after the first function is ran... I think it runs the second function before it renders the html to the screen.

Does anyone know how to go about sorting this out?
0
Comment
Question by:DEGtheLEG
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 40

Expert Comment

by:gurvinder372
ID: 36487464
how does drawTable method renders the table?
0
 
LVL 16

Expert Comment

by:Easwaran Paramasivam
ID: 36487465
use semicolon to seperate 2 functions. This will execute one after another.
onclick="drawTable();updateTable()"

0
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 500 total points
ID: 36487508
if you are making any ajax calls in drawTable(), then you need to invoke updateTable() in its call back handler only
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question