I need code which incorporates 3 windows – The first window, window “a” will be the opening window, this contains the start page. Javascript will not be used to open this first window – one would simple use ‘file- open file’ to open this page. Call it firstwindow.html –
-Window “b” will be the pop up window that will be dynamically created and into which one would write text into.
-Window “c” will be the window in which you will load an external site; you will not be creating this page but rather loading this link into a new window.
Window “a” details:
In window a, you will define two functions in your source code. The function names will be: myLoad() and myPreview().
The myLoad() function will be called on the onLoad user event of your document object.
The myLoad() function will set your window a to be the 90% of the available width and 90% of the available height of your monitor screen. This function will also move the page to the 0,0 coordinates on the screen.
In window a, you will define three arrays in your JavaScript code. These arrays must be defined script-level not inside a function.
The first array will hold the names of 5 Web sites. You will use the names of the sites, not the URLS. Please use no fewer than 5 sites and no more than 10. Please do not name the array “links” as this is a reserved array name in JavaScript.
create a second array which will hold a simple description of the web site. This should only be a sentence of two.
create a third array that will hold the URLs of the 5 Web sites.
For each of the arrays, you must initialize each array as an instance of the Array object, but without specifying a number of elements, so that the arrays are dynamic. To load the arrays, use the push() method of the Array object to load the arrays: sitename.push(“site one”); sitename.push(“site two”);
On the window a page (firstwindow.html) you will create 5 links. Each web site name will be a link that stays anchored on the page, but calls a function with the onClick user event. It should look like this <a href = “#” onClick = “myPreview(4)”>. Into your function you will pass the number which represents the position of the array your site name occupies. For example, for the first site in the array, you will pass 0. You can hardcode these links in HTML
The myPreview() funciton will receive the number from the argument to the function and use that to determine which element in your links array to access. The myPreview() function will open up window b. It will define a new window var windowb and will check to see if windowb is open. If windowb is currently open, the myPreview function will first close windowb, then re-open windowb using window.open().
Window “b” details:
The myPreview() function, defined and called in window a, will open, define and create window b.
For window b, the menubar will be set to no, you also must set at 400 pixels wide and 300 pixels tall.
The title of window b will be the same as the site name in your site name array (your first array). Your pop up window will not be a pre-designed page, but rather you will use “” to denote to open up a blank window. You will write all the html into the pop up window, including all of your html tags.
As you are writing the html into the new pop up window, you will also write in the element from your description array that holds the short description of the site and the link to the external site using the third array, which contains the URLS. In the <a href> tag you will create in windowb, you will use target = “_blank” to open up the external site in a new window.
Window “c” details:
a challenge for you hardcore dev peeps out there from a lowly designer…