OSDN Git Service

translated
[nucleus-jp/nucleus-jp-ancient.git] / utf8 / nucleus / javascript / compatibility.js
1 /**\r
2   * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) \r
3   * Copyright (C) 2002-2004 The Nucleus Group\r
4   *\r
5   * This program is free software; you can redistribute it and/or\r
6   * modify it under the terms of the GNU General Public License\r
7   * as published by the Free Software Foundation; either version 2\r
8   * of the License, or (at your option) any later version.\r
9   * (see nucleus/documentation/index.html#license for more info)\r
10   *\r
11   *     Javascript code to make sure that:\r
12   *  - javascript still works when sending pages as application/xhtml+xml\r
13   *  - this doesn't break functionality in IE\r
14   *\r
15   * How to use:\r
16   *             - Include this file\r
17   *             - Use createElement() instead of document.createElement()\r
18   *\r
19   * That's basically it :)\r
20   */\r
21 \r
22 // to get the script working when page is sent as application/xhtml+xml\r
23 function createElement(element) {\r
24   if (document.createElementNS) {\r
25         return document.createElementNS('http://www.w3.org/1999/xhtml', element);\r
26   }\r
27   if (document.createElement) {\r
28         return document.createElement(element);\r
29   }\r
30   return false;\r
31 }\r