Log in

View Full Version : iframe alternative



veganeatingout
07-15-2008, 05:26 AM
Hi! I hope you can help me because I've been looking for hours for a good solution to this and with my limited web knowledge I can't seem to find one.

What I do know: XHTML, Some JavaScript and bits of everything else.

I'm looking to replace an iframe possibly with a div or object tag but I need it to be able to either load html or provide an easy to understand (by me) loading of data (xml?).

I also want to be able to scroll the data without a scrollbar from seperate images.

If you need more explanation please ask me because I'm lost and I've tried many "almosts".

molendijk
07-15-2008, 09:57 AM
I'm looking to replace an iframe possibly with a div or object tag

This (http://dynamicdrive.com/forums/showthread.php?t=31541), or this (http://dynamicdrive.com/forums/showthread.php?t=30079), or this (http://dynamicdrive.com/forums/showthread.php?t=29559)?
===
Arie Molendijk.

codeexploiter
07-15-2008, 11:19 AM
If the data you are loading is from your domain itself then you can even try to use AJAX (http://en.wikipedia.org/wiki/AJAX) for the loading purpose when you need that content.

molendijk
07-15-2008, 11:57 AM
If the data you are loading is from your domain itself then you can even try to use AJAX (http://en.wikipedia.org/wiki/AJAX) for the loading purpose when you need that content.
And a (very basic) example would be:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<title>Htranscluder</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">

<script type="text/javascript">
document.includeWrite = function (url) {
if ('undefined' == typeof(url)) return false;
if (window.XMLHttpRequest)reqWrite = new XMLHttpRequest()
else if (window.ActiveXObject){
try {
reqWrite = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
reqWrite = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
reqWrite.open("GET",url,false); reqWrite.send(null); document.write(reqWrite.responseText);
}
</script>

</head>

<body>

text
<script type="text/javascript">
document.includeWrite('includeme.html')
</script>
<p>text</p>

</body>

</html>

which would include includeme.html.
===
Arie.