Hi swykpisz,
To make this script work with inline frames (whether generated by
<IFRAME> or a normal frame), all you have to do is to change one line
of your script:
Change this line:
linkHtml += "<a href='" + todaysLink + "'>Today's link is ";
to say:
linkHtml += "<a href='" + todaysLink + "'
target="NAME_OF_YOUR_FRAME_HERE">Today's link is ";
Here's a sample page I created that uses the IFRAME construct:
-----------------------------------------------------------------------
<html>
<head><title>My Page</title>
</head>
<body>
<a href="://www.google.com" target="googleanswers">Hi there</a>
<iframe src="http://answers.google.com" title="Google Answers"
name="googleanswers" scroll=auto></iframe>
</body>
</html>
-----------------------------------------------------------------------
I hope that answered your question. If you still need clarification,
please don't hesitate to request for it.
secret901-ga
Search Strategy:
IFRAME |
Request for Answer Clarification by
swykpisz-ga
on
01 Mar 2003 20:25 PST
I need to know what the source would be for the iframe from the
javascript if it generates a different link for each day. Is there any
working examples out there? Do iframes look in a directory then a
target? Any help would be greatly appreciated,thanks
|
Clarification of Answer by
secret901-ga
on
01 Mar 2003 21:15 PST
Hi swykpisz,
Here's an HTML for a working example of the script:
------------------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Sample: Your Daily Link</title>
</head>
<body>
<iframe src="http://answers.google.com" title="Google Answers"
name="googleanswers" scroll=auto></iframe>
<h1>Sample: Your Daily Link</h1>
<script type="text/javascript"><!--
var linkList = new Array();
var i = 1;
var todaysLink = "";
var linkHtml = "";
var dateNow = new Date();
var dayOfMonth = dateNow.getDate();
linkList[i++] = "http://www.day1.com";
linkList[i++] = "http://www.day2.com";
linkList[i++] = "http://www.day3.com";
linkList[i++] = "http://www.day4.com";
linkList[i++] = "http://www.day5.com";
linkList[i++] = "http://www.day6.com";
linkList[i++] = "http://www.day7.com";
linkList[i++] = "http://www.day8.com";
linkList[i++] = "http://www.day9.com";
linkList[i++] = "http://www.day10.com";
linkList[i++] = "http://www.day11.com";
linkList[i++] = "http://www.day12.com";
linkList[i++] = "http://www.day13.com";
linkList[i++] = "http://www.day14.com";
linkList[i++] = "http://www.day15.com";
linkList[i++] = "http://www.day16.com";
linkList[i++] = "http://www.day17.com";
linkList[i++] = "http://www.day18.com";
linkList[i++] = "http://www.day19.com";
linkList[i++] = "http://www.day20.com";
linkList[i++] = "http://www.day21.com";
linkList[i++] = "http://www.day22.com";
linkList[i++] = "http://www.day23.com";
linkList[i++] = "http://www.day24.com";
linkList[i++] = "http://www.day25.com";
linkList[i++] = "http://www.day26.com";
linkList[i++] = "http://www.day27.com";
linkList[i++] = "http://www.day28.com";
linkList[i++] = "http://www.day29.com";
linkList[i++] = "http://www.day30.com";
linkList[i++] = "http://www.day31.com";
todaysLink = linkList[dayOfMonth];
linkHtml += "Today's link is <a href='" + todaysLink + "'
target='googleanswers'>";
linkHtml += todaysLink + "</a> ";
document.write(linkHtml);
// --></script>
</body>
</html>
-------------------------------------------------------------
When you click on the link, it will change the page in the inline
frame so that it goes to the specified page. You can find the page
here:
http://www.ics.uci.edu/~dhnguyen/test.htm
If you need further help, please provide me with the HTML source of
your current page and I'll be happy to assist you in adding a link
randomizer to it.
secret901-ga
|
Request for Answer Clarification by
swykpisz-ga
on
01 Mar 2003 21:38 PST
Right now the page is at
http://home.earthlink.net/~wykpisz/firstone.html
I'm trying to get the
http://home.earthlink.net/~wykpisz/just-trying.txt link to be display
inside the inline frame which would be correct for March 2nd but I get
an error,I don't need the hyperlink displayed just the page inside the
frame,the code is:
Hello Swykpisz,
Use the following HTML page:
---
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Sample: Your Daily Link</title>
</head>
<body>
<h1>Sample: Your Daily Link</h1>
<script type="text/javascript"><!--
var linkList = new Array();
var i = 1;
var todaysLink = "";
var linkHtml = "";
var dateNow = new Date();
var dayOfMonth = dateNow.getDate();
linkList[i++] = "http://www.example.com";
linkList[i++] = "http://home.earthlink.net/~wykpisz/just-trying.txt";
linkList[i++] = "http://example.net";
linkList[i++] = "http://www.example.com";
linkList[i++] = "http://www.example.org";
linkList[i++] = "http://example.net";
linkList[i++] = "http://www.example.com";
linkList[i++] = "http://www.example.org";
linkList[i++] = "http://example.net";
linkList[i++] = "http://www.example.com";
linkList[i++] = "http://www.example.com";
linkList[i++] = "http://www.example.org";
linkList[i++] = "http://example.net";
linkList[i++] = "http://www.example.com";
linkList[i++] = "http://www.example.org";
linkList[i++] = "http://example.net";
linkList[i++] = "http://www.example.com";
linkList[i++] = "http://www.example.org";
linkList[i++] = "http://example.net";
linkList[i++] = "http://www.example.com";
linkList[i++] = "http://www.example.com";
linkList[i++] = "http://www.example.org";
linkList[i++] = "http://example.net";
linkList[i++] = "http://www.example.com";
linkList[i++] = "http://www.example.org";
linkList[i++] = "http://example.net";
linkList[i++] = "http://www.example.com";
linkList[i++] = "http://www.example.org";
linkList[i++] = "http://example.net";
linkList[i++] = "http://www.example.com";
linkList[i++] = "http://www.example.com";
todaysLink = linkList[dayOfMonth];
linkHtml += "<a href='" + todaysLink + "'>Today's link is "
linkHtml += todaysLink + "</a> ";
document.write(linkHtml);
// --></script>
<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#808080" width="241">
<tr>
<td height="30" background="images/bkgrnd.gif"
width="100%" align="left" valign="bottom">
<a href="newsframe.htm" target="news">
<img border="0" src="local_tab.gif" alt="Local News"
width="76" height="25"></a></td>
</tr>
<tr>
<td height="143" bgcolor="#FFFFFF" valign="top"
align="center">
<table border="0" cellpadding="3" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111" width="100%"
id="AutoNumber6">
<tr>
<td width="100%">
<iframe name="news" border="0" frameborder="0"
width="100%" height="252" src="newsframe.htm" align="top"
target="_top">
Your browser does not support inline frames or is
currently configured not to display inline frames.</iframe>
</td>
</body>
</html>
|
Clarification of Answer by
secret901-ga
on
01 Mar 2003 21:50 PST
Hi swykpisz,
I have updated the page http://www.ics.uci.edu/~dhnguyen/test.htm so
that it looks like your page. Your inline frame is called "news," so
I used it as the target of the links. I changed my calendar to read
March 2 (it's still March 1 here) and then opened the page. Your test
page correctly popped up into the IFRAME.
I hope this answered my question, if you are still confused, please
request for a clarification before rating this answer.
secret901-ga
|
Request for Answer Clarification by
swykpisz-ga
on
01 Mar 2003 22:00 PST
I appreciate your patience on this subject but how do I get the link
of the day to be displayed in the inline frame? I get an error saying
the source file is not located no matter what I name the iframe name.
Is it possible to have the source file to be different each day?
|
Clarification of Answer by
secret901-ga
on
01 Mar 2003 22:12 PST
Hi swykpisz,
I think I understand what you want. Is what you really want is for
the IFRAME to show the linked page immediately when the page loads,
without the intervention of the user? Currently, the IFRAME will NOT
load your linked page until the user clicks on the link. Please tell
me if this is the case.
secret901-ga
|
Clarification of Answer by
secret901-ga
on
01 Mar 2003 22:31 PST
Hi swykpisz,
Below is another version of the page that sets the IFRAME to the
linked page without user intervention. Please tell me if this is what
you want.
http://www.ics.uci.edu/~dhnguyen/test2.htm
|