View Full Version : [Q] How to supply the source file for the DIV tag???
01-30-2005, 06:07 PM
I was reading this article...
It looks good... I was wondering if I could specify the external file for the content...
For example, it says...
<div id="header">Header Section</div>
<div id="leftcol">Left Section</div>
<div id="content">Content Section</div>
<div id="rightcol">Left Section</div>
<div id="footer">Footer Section</div>
and I want it to be something like this(of course, not a valid syntax...)
01-30-2005, 08:28 PM
I'm no expert at things like this, but i think that you need to use php for something like that... At least all the places where i can think of html being reused it seems to be php.
02-01-2005, 02:14 AM
Found it... DIV accepts source file the same way iframe does... :)
02-01-2005, 04:25 PM
Thanks for the article link CyanBlue. Gave me the answer to a problem i was having as well.
02-01-2005, 06:33 PM
Hm... NOW... Does anybody know how I can refresh the content of one DIV from another???
02-01-2005, 10:46 PM
In my case I have a select statement that when a certain item is selected a div is turned visible for more options.
I'll have something tommorrow if you dont find a solution.
02-01-2005, 10:53 PM
Here is abit more detailed version of that question if anybody can help me... :D
I have two DIV frames...
<div id="leftcol"><?php include("navL.html"); ?></div>
<div id="content"><?php include("content.php"); ?></div>
and in the leftcol DIV frame, I have navL.html file loaded... (If you know of better way of doing it, please let me know... ;))
This is the content of the navL.html file...
document.getElementByID("content").src = arg + ".html";
In there I have two links which I want to use to update the content DIV frame with either test1.html or test2.html depending on the link that is clicked, but somehow it is not working... :(
Does anybody know how I can solve this problem???
Thank you very much... :)
08-03-2007, 06:21 AM
<div src="fn.htm" ></div>
This is not wokring for me. Could somebody suggest me.
12-11-2007, 12:50 PM
Reply for Sreeni Ques..
It Wont work bcoz div doesn't an attrib called src..
May be this could answer your question :) :) :)
document.getElementById("myDiv").innerHTML = "<iframe src='"+userFile+"' width=800 height=300 frameborder=0 scrolling=yes>";
Default content for Div
<input type="button" onClick="setMyDiv('http://www.google.com/')" value="Google" />
<input type="button" onClick="setMyDiv('http://www.altavista.com/')" value="Altavista" />
vBulletin® v3.8.5, Copyright ©2000-2014, Jelsoft Enterprises Ltd.