Content Loading

Go To StackoverFlow.com

0

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


1

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


1

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 :

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


0

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

2009-06-16 07:57
by Sev