My JavaScript skills only go so far and as I plunge in a bit deeper I have hit a wall on this one.
I got this array to work but I just know it can be written better:
var data = new Array();
data[1] = "<iframe src='news.htm' width=100% height=100% frameborder=0 scrolling=no></iframe>";
data[2] = "<iframe src='alaska.htm' width=100% height=100% frameborder=0 scrolling=no></iframe>";
Notice that the only difference between the two sets is the source while everything else remains identical.
Is there a way to write this where the <iframe> properties are already defined, like in another variable, and the only thing that needs to be specified in the array would be the source?
For Example:
var data = new Array();
data[1] = "src='news.htm'";
data[2] = "src='alaska.htm'";
Thus making it easier to update when the source needs to be changed.
Thanks.
I got this array to work but I just know it can be written better:
var data = new Array();
data[1] = "<iframe src='news.htm' width=100% height=100% frameborder=0 scrolling=no></iframe>";
data[2] = "<iframe src='alaska.htm' width=100% height=100% frameborder=0 scrolling=no></iframe>";
Notice that the only difference between the two sets is the source while everything else remains identical.
Is there a way to write this where the <iframe> properties are already defined, like in another variable, and the only thing that needs to be specified in the array would be the source?
For Example:
var data = new Array();
data[1] = "src='news.htm'";
data[2] = "src='alaska.htm'";
Thus making it easier to update when the source needs to be changed.
Thanks.