NAME__________________________________________________________________________________
1. (50 points) The form (named f1) to the left contains a textarea named d1 which is string of XML.
The DTD for this XML is:
<?xml version="1.0"?> This data (from http://appshopper.com/bestsellers/paid) shows the top 200 paid iphone apps. Assume the following code exists in the javascript function p1 that loads the string of XML shown to the left into the Microsoft XMLDOM (DO NOT write this code):
xmldata=document.f1.d1.value;
Show NO HTML. Show NO heading. Show only the javascript for p1().
This is DIV with id="p1_out"
| |||||||||||||||||||||||||||||||||||||||
2. (50 points) Four images: <img id="i0" src="red1x1.gif">, <img id="i1" src="blue1x1.gif">, <img id="i2" src="green1x1.gif">, and <img id="i3" src="yellow1x1.gif"> are inside the square DIV block shown to the left. The four textboxes shown to the left are in a form named f2 and are named: rc, bc, gc and yc. The javascript function p2 sets six CSS properties of each of the four images according to the following table:
1. retrieve, calculate, and place the values shown above for: height, width, top and left into two four element arrays. (NOTE: only two arrays since: (a) top and left are equal and (b) height and width are equal) 2. inside a loop (whose index varies from 0 → 3) use the following DOM reference to perform the six CSS property assignments for each of the four images:
Do NOT place the images in the DIV block (they are already there).
Show NO HTML. Show only the javascript for p2(). |