469,327 Members | 1,337 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,327 developers. It's quick & easy.

Grabing content from server

I'd like to create a function that grabs some content from a server (html
file) and puts this content into a DIV.
This way I don't have to reload the whole page to update just a portion of
the page.
How can I do it?
Thanks,

--

Kerberos.

http://www.opera.com
http://www.freebsd.org
http://www.auriance.com
http://www.osresources.com
http://exodus.jabberstudio.org
Jul 23 '05 #1
4 1011


Kerberos wrote:
I'd like to create a function that grabs some content from a server
(html file) and puts this content into a DIV.


What is wrong with
<div>
<iframe name="iframeName" width="100%" height="200"
src="whatever.html"></iframe>
</div>
and then using links e.g.
<a href="htmlFile.html" target="iframeName">link</a>
or if you need scripting
if (window.frames && window.frames.iframeName) {
window.frames.iframeName.location.href = 'htmlFile.html';
}

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
Em Tue, 18 Jan 2005 15:00:23 +0100, Martin Honnen <ma*******@yahoo.de>
escreveu:
What is wrong with
<div>
<iframe name="iframeName" width="100%" height="200"
src="whatever.html"></iframe>
</div>
and then using links e.g.
<a href="htmlFile.html" target="iframeName">link</a>
or if you need scripting
if (window.frames && window.frames.iframeName) {
window.frames.iframeName.location.href = 'htmlFile.html';
}


The problem with iframes is, beside the fact that frames in general are
deprecated, that the content wraps inside the frame. Using a div, it
extends to 100%.

I've been using iframes so far, but I'm looking for another solution.
Thanks,

--

Kerberos.

http://www.opera.com
http://www.freebsd.org
http://www.auriance.com
http://www.osresources.com
http://exodus.jabberstudio.org
Jul 23 '05 #3


Kerberos wrote:

I've been using iframes so far, but I'm looking for another solution.


The FAQ has
<http://jibbering.com/faq/#FAQ4_38>
and there is also the download behavior in IE/Win:
<http://www.faqts.com/knowledge_base/view.phtml/aid/1268/fid/126>
but all that is much weaker in terms of cross browser support compared
to iframes, in particular when you want to load and render HTML.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #4
Em Tue, 18 Jan 2005 17:19:26 +0100, Martin Honnen <ma*******@yahoo.de>
escreveu:
The FAQ has
<http://jibbering.com/faq/#FAQ4_38>


Thanks! I found the XML HTTP Request object quite interesting. It's
exactly what I was looking for, it even talks about Gmail ;)

--

Kerberos.

http://www.opera.com
http://www.freebsd.org
http://www.auriance.com
http://www.osresources.com
http://exodus.jabberstudio.org
Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by clintonG | last post: by
4 posts views Thread by Taxi Driver | last post: by
1 post views Thread by athirumurthi | last post: by
7 posts views Thread by xkeops | last post: by
11 posts views Thread by Trapulo | last post: by
3 posts views Thread by MikeB | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by listenups61195 | last post: by
reply views Thread by Purva khokhar | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.