\n"); } else { header("Content-type: text/html; charset=utf-8"); } ?>
Type the following code into a file named scripts/skeleton.js, and edit your index.xhtml page so it has links to both core.js and this file. Verify that it works.
if (typeof Core === "object") { Core.start ( ( function() { return { init: function(evt) { alert("Hello, World!"); } }; } )() ); } else { alert ("Core library missing"); }
Make two copies of skeleton.js (In Dreamweaver, select skeleton.js, and type Ctrl-D to duplicate the file; do that again to make another copy.) Rename the two copies assignment_03A.js and assignment_03B.js, and update your index.xhtml file so it has three links, the existing one to core.js, and two to these two files.
Add a local variable named msg to the anonymous self-execting function in both the script files you just created. Make the value of the msg variable a string that includes the script file name in it, such as “Hello from 3A.” Change the alert call in both files so it displays the value of its msg variable. Verify that the code works.
When you have tested your web site and verified that everything validates and runs correctly, log out so your site will be copied back to the server. Then send me an email to let me know your assignment is ready for grading: I will copy your site from the lab server to babbage to verify that it is correct.
Send your email to vickeryatbabbage.cs.qc.cuny.edu with CS-90.3 Assignment 3, spelled and capitalized just like that. Be sure to put your email address inside the message you send.