Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loading Remote content dynamically into DIV Area. MSIE

Status
Not open for further replies.

prelude

IS-IT--Management
May 9, 2002
1
GB
I am trying to load a document from a remote URL into a pre-existing DIV area. I build the URL dynamically using javascript based upon user form input and would like to display the results of the query within the same page within a pre-existing DIV area. In Netscape I have accomplished this easily by setting the src property of the layer (document.layers.mydivId.src = theURLIbuild;) I cannot figure out how to accomplish this in MSIE. I am wondering if there is a property within the document.all.mydivId object that can be set to a URL to accomplish the same result under MSIE?

<SCRIPT>
function getDoc(x,y) {
var str='str += x + '&y=' + y;
if(document.layers)
document.layers.mydivId.src = str;
else if(document.all)
alert('do not know what to do here.');
}
</SCRIPT>
...
<DIV ID=&quot;mydivId&quot;>
<FORM NAME=theForm>
<INPUT TYPE=text NAME=x><BR>
<INPUT TYPE=text NAME=y><BR>
<INPUT TYPE=button VALUE=&quot;getDoc&quot; onClick='getDoc(document.theForm.x.value,document.theForm.y.value)'>
</FORM>
</DIV>
 
This might help although I have not used it myself.

[sig]<p>Crystal<br><a href=mailto:crystals@genesis.sk.ca>crystals@genesis.sk.ca</a><br><a href= > </a><br>--------------------------------------------------<br>
Experience is one thing you can't get for nothing.<br>
-Oscar Wilde<br>
[/sig]
 
Use the <iframe src=&quot;&quot;> tag instead of <div> for IE, and for Netscape use <layer src=&quot;&quot;>. Basically, you will need a browser detection script that writes <iframe ..etc..> for IE and <layer ...etc...> for NS. <iframe> can be controlled the same way a <div> can, with style=&quot;position:absolute&quot; and other attributes. [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top