Forum Moderators: open

Message Too Old, No Replies

load method of Layer

not working properly

         

kadnan

6:49 am on Feb 22, 2006 (gmt 0)

10+ Year Member



HI
I just came across load() method to load external file content.AFAIK,it works for "LAYER" tag only

i specified a layer like

<layer id="a" name="a">Testing</layer>

<script language="javascript" type="text/javascript">
function loadme()
{
document.a.load("loadme.html",100);
}
</script>

its saying object expected.

kindly explain me with some short example

Thanks

DrDoc

6:52 am on Feb 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<layer> is a Netscape 4 proprietary relic.

You want to be looking at <iframe> instead.

kadnan

6:53 am on Feb 22, 2006 (gmt 0)

10+ Year Member



i just read this: [webmasterworld.com...]

i would prefer DIV over LAYER now,ajax can be used to get POSTed data,while LOAD don't support this property

[edited by: DrDoc at 6:54 am (utc) on Feb. 22, 2006]
[edit reason] linked URL [/edit]

DrDoc

6:55 am on Feb 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Divs cannot contain entire pages. That's what iframes are for. Divs can contain regular HTML data, though.

What are you using AJAX for?

kadnan

11:26 am on Feb 22, 2006 (gmt 0)

10+ Year Member



i want to submit form via xmlhttp object and retrieve response in dIV

DrDoc

8:49 pm on Feb 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use an iframe. Submit the form with the iframe as the target. That's what you're looking for. And it is both faster, better, and more reliable.

Bernard Marx

9:22 am on Feb 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Doc, what method would you use as a callback?
(ie. how would you know when you have received a reply - an embedded onload function?)

DrDoc

5:48 pm on Feb 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OP said he/she wants to display the response in a div ... This would simply display the response directly in the iframe to which the form was submitted. No need for callback functions. In fact, no need for JavaScript at all. AND, best of all, it now becomes much more reliable and accessible for everyone. :)