OSDN Git Service

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