OSDN Git Service

merged 3.3 beta1
[nucleus-jp/nucleus-jp-ancient.git] / utf8 / nucleus / javascript / compatibility.js
1 /**
2   * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) 
3   * Copyright (C) 2002-2006 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,v 1.4 2006-07-12 07:11:47 kimitake Exp $
22   * $NucleusJP: compatibility.js,v 1.3 2005/03/12 06:19:04 kimitake Exp $
23   */
24
25 // to get the script working when page is sent as application/xhtml+xml
26 function createElement(element) {
27   if (document.createElementNS) {
28         return document.createElementNS('http://www.w3.org/1999/xhtml', element);
29   }
30   if (document.createElement) {
31         return document.createElement(element);
32   }
33   return false;
34 }