For an assignment, I have to make a web page that switches images in the "RightFrame" by clicking hyperlinks in the "LeftFrame". I'm supposed to use this function:
<head>
<title>Assignment</title>
<script>
function setImage(index)
{
if (index == 1)
{
RightFrame.document.RightImage.src = "Alumni Hall.jpg";
}
if (index == 2)
{
RightFrame.document.RightImage.src = "Clock Tower.jpg";
}
if (index == 3)
{
RightFrame.document.RightImage.src = "Elliot Hall.jpg";
}
if (index == 4)
{
RightFrame.document.RightImage.src = "Football Field.jpg";
}
if (index == 5)
{
RightFrame.document.RightImage.src = "North Hall.jpg";
}
if (index == 6)
{
RightFrame.document.RightImage.src = "South Hall.jpg";
}
if (index == 7)
{
RightFrame.document.RightImage.src = ="Straughn Hall.jpg";
}
return;
}
</script>
</head>
<frameset cols="20%,*">
<frame name="LeftFrame" src="left3.html">
<frame name="RightFrame" src="right1.html">
</frameset>
</html>
However, I can't get it to run without cross origin errors. I've been trying everything in my knowledge to get it to work, but I'm still new to this. Help would really be appreciated.
Aucun commentaire:
Enregistrer un commentaire