delo2795
01-07-2012, 12:35 PM
I am having a problem with my homework displaying an iframe using JavaScript.
My homework states:
Insert a script element that does the following:
part a. Insert the following multiline comment:
Display the daily schedule in an inline frame. Daily schedules are stored in the files
sunday.html through saturday.htm.
part b.
Insert a command to write the HTML code
<iframe src="weekday.htm'></iframe>
to the Web page, where weekday is the text string returned by the weekDay() function.
What I have so far:
<script type= "text/javascript">
/* Display part a */
document.write("<iframe src='weekday.htm'></iframe">;
</script>
My Question:
How do I display weekday.htm within my script on a specific day using the function weekDay() function.
below is my weekDay() function:
function weekDay(){
thisDate = new Date();
var thisWDay=thisDate.getDay();
var wdName = new Array("sunday", "monday", "tuesday", "wednesday",
"thursday", "friday", "saturday");
return wdName[thisWDay];
}
My homework states:
Insert a script element that does the following:
part a. Insert the following multiline comment:
Display the daily schedule in an inline frame. Daily schedules are stored in the files
sunday.html through saturday.htm.
part b.
Insert a command to write the HTML code
<iframe src="weekday.htm'></iframe>
to the Web page, where weekday is the text string returned by the weekDay() function.
What I have so far:
<script type= "text/javascript">
/* Display part a */
document.write("<iframe src='weekday.htm'></iframe">;
</script>
My Question:
How do I display weekday.htm within my script on a specific day using the function weekDay() function.
below is my weekDay() function:
function weekDay(){
thisDate = new Date();
var thisWDay=thisDate.getDay();
var wdName = new Array("sunday", "monday", "tuesday", "wednesday",
"thursday", "friday", "saturday");
return wdName[thisWDay];
}