Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Supporting Technologies > HTML and JavaScript

Reply
 
Thread Tools Rate Thread Display Modes
Old 01-30-2005, 07:07 PM   #1
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,878
Default [Q] How to supply the source file for the DIV tag???

Howdy...

I was reading this article...

http://www.devarticles.com/c/a/Web-S...ut-with-CSS/6/

It looks good... I was wondering if I could specify the external file for the content...

For example, it says...
HTML Code:
<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...)
HTML Code:
<div id="header">header.html</div>
<div id="leftcol">navigation.html</div>
<div id="content">content.html</div>
<div id="rightcol">extra.html</div>
<div id="footer">footer.html</div>
Thanks...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 01-30-2005, 09:28 PM   #2
Laguana
Well known nobody
 
Join Date: Jul 2004
Location: Australia
Posts: 818
Default

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.
Laguana is offline   Reply With Quote
Old 02-01-2005, 03:14 AM   #3
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,878
Default

Found it... DIV accepts source file the same way iframe does...
HTML Code:
div src="somefile.html"></div>
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 02-01-2005, 05:25 PM   #4
Gibberish
WHAT!?
 
Join Date: Aug 2004
Location: San Diego, CA
Posts: 1,774
Default

Thanks for the article link CyanBlue. Gave me the answer to a problem i was having as well.
Gibberish is offline   Reply With Quote
Old 02-01-2005, 07:33 PM   #5
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,878
Default

Hm... NOW... Does anybody know how I can refresh the content of one DIV from another???
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 02-01-2005, 11:46 PM   #6
Gibberish
WHAT!?
 
Join Date: Aug 2004
Location: San Diego, CA
Posts: 1,774
Default

I am creating something like that right now. I am going to use the onSelect function to tell a javascript to run a function that turns my other div visible.

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.
Gibberish is offline   Reply With Quote
Old 02-01-2005, 11:53 PM   #7
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,878
Default

Here is abit more detailed version of that question if anybody can help me...

I have two DIV frames...
HTML Code:
<body>
    <div id="leftcol"><?php include("navL.html"); ?></div>
    <div id="content"><?php include("content.php"); ?></div>
</body>
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...
HTML Code:
<script type="text/javascript">
    <!--

    function load(arg)
    {
        alert(arg);
        document.getElementByID("content").src = arg + ".html";
    }

    //-->
</script>

<a href="#" onClick="javascript:load('test1');">test1</a>
<BR>
<a href="#" onClick="javascript:load('test2');">test2</a>
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...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 08-03-2007, 07:21 AM   #8
sreeni
Registered User
 
Join Date: Aug 2007
Location: Tirupati, AP, India
Posts: 1
Send a message via MSN to sreeni Send a message via Yahoo to sreeni Send a message via Skype™ to sreeni
Default src in Div Tag

<div src="fn.htm" ></div>
This is not wokring for me. Could somebody suggest me.

Best Regards
Sreeni
sreeni is offline   Reply With Quote
Old 12-11-2007, 01:50 PM   #9
mmkader85
Registered User
 
Join Date: Dec 2007
Posts: 1
Thumbs up

Reply for Sreeni Ques..
It Wont work bcoz div doesn't an attrib called src..
Instead you can make use of the javascript+iframe to do the magic for you..

May be this could answer your question
================================================== =======================
<html>
<head>
<script type="text/javascript">
function setMyDiv(userFile)
{
document.getElementById("myDiv").innerHTML = "<iframe src='"+userFile+"' width=800 height=300 frameborder=0 scrolling=yes>";
}
</script>
</head>
<body onLoad="setMyDiv('http://www.altavista.com/')">
<div id="myDiv">
Default content for Div
</div>
<br />
<br />
<form>
<input type="button" onClick="setMyDiv('http://www.google.com/')" value="Google" />
<input type="button" onClick="setMyDiv('http://www.altavista.com/')" value="Altavista" />
</form>
</body>
</html>
================================================== =======================
mmkader85 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:01 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.