cvs: phpweb / userprefs.js
| From: | Gabor Hojtsy | Date: | Sun, 09 Jan 2005 16:09:29 +0000 |
| Subject: | cvs: phpweb / userprefs.js | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-27133@lists.php.net to get a copy of this message | ||
goba Sun Jan 9 11:09:29 2005 EDT
Modified files:
/phpweb userprefs.js
Log:
traverse the elements for the head element, since we cannot add an id on the head and otherwise
cannot check for its name, since it is lowercase in XHTML mode and uppercase in HTML mode
http://cvs.php.net/diff.php/phpweb/userprefs.js?r1=1.10&r2=1.11&ty=u
Index: phpweb/userprefs.js
diff -u phpweb/userprefs.js:1.10 phpweb/userprefs.js:1.11
--- phpweb/userprefs.js:1.10 Sun Jan 9 07:53:34 2005
+++ phpweb/userprefs.js Sun Jan 9 11:09:29 2005
@@ -115,11 +115,14 @@
}
}
if (searchEnabled && document.getElementsByTagName && document.createElement) {
- if (head = document.getElementsByTagName("head") && head.length == 1) {
- var scriptElem = document.createElement('script');
- scriptElem.setAttribute('type', 'text/javascript');
- scriptElem.setAttribute('src', '/functions.js');
- head[0].appendChild(scriptElem);
+ var elems = document.getElementsByTagName("*");
+ for (var i = 0; i < elems.length; i++) {
+ if (elems[i].tagName.toLowerCase() == 'head') {
+ var scriptElem = document.createElement('script');
+ scriptElem.setAttribute('type', 'text/javascript');
+ scriptElem.setAttribute('src', '/functions.js');
+ elems[i].appendChild(scriptElem);
+ }
}
}
}