Content Loading

Go To


I am creating new Page with two divs.This Page Loading within Iframe.

First Div get contents from Database then load.Second Div contains Save and Cancel Button Only.

At the Time of loading Save and Cancel Button (Second Div) comes first.How to avoid this??

2009-06-16 07:51
by Saravanan


Hide the second div via CSS.

Then add some javascript which unhiddes the div when the loading from the DB is finished

2009-06-16 07:57
by jitter


Have the first document load the second document when it's ready. With a onload handler on the first document that sets the location of the second iframe.

Let's say your iframes have 2 ids: "iframe1" and "iframe2". You load the database content in iframe1, and an empty page in iframe2.

Here is a sample code for the document loaded in iframe1 :

function init () {
   frameElement.ownerDocument.getElementById("iframe2").contentWindow.location = "/someurl/document2.html";
<body onload="init()">
<!-- iframe1 content -->
2009-06-16 08:31
by Alsciende


Dynamically load the content using something like JQuery or Prototype to control when and how divs load.

2009-06-16 07:57
by Sev