1 // Start the bidding at 42 for no particular reason.
4 function canonicalize(url)
6 // It would be more elegant to use the DOM here, but we use document.write()
7 // so the tests run correctly in Firefox.
9 document.write("<a id='" + id + "' href='" + url + "'></a>");
10 return document.getElementById(id).href;
13 function setBaseURL(url)
15 // It would be more elegant to use the DOM here, but we chose document.write()
16 // so the tests ran correctly in Firefox at the time we originally wrote them.
18 // Remove any existing base elements.
19 var existingBase = document.getElementsByTagName('base');
20 while (existingBase.length) {
21 var element = existingBase[0];
22 element.parentNode.removeChild(element);
25 // Add a new base element.
26 document.write('<base href="' + url + '">');
29 function segments(url)
31 // It would be more elegant to use the DOM here, but we use document.write()
32 // so the tests run correctly in Firefox.
34 document.write("<a id='" + id + "' href='" + url + "'></a>");
35 var elmt = document.getElementById(id);
36 return JSON.stringify([