views:

67

answers:

2

I'm writing a plugin for jQuery. Turns out that in order to use it a page HTML must containt the following code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
<html xmlns:v="urn:schemas-microsoft-com:vml"
 xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
  <?import namespace="v" implementation="#default#VML" ?>
  <style>
    v\:* { behavior: url(#default#VML); display:inline-block}
  </style>

The plugin is intended for personal use only but I want to hide all the details inside it. How can move the code above into the plugin using JavaScript + DOM.

Also I use this code only for IE, for other browsers I have a different code which works fine. So IE specific solutions are welcome.

A: 

document.namespaces.add('v', 'urn:schemas-microsoft-com:vml').doImport('#default#VML'); document.namespaces.add('o', 'urn:schemas-microsoft-com:office:office');

Евгений
A: 

HTML (unlike XHTML) doesn't support <?processing instructions?>. You need to use an XHTML DOCTYPE on that page for.

Eli Grey