I'm attempting to write a quick piece of Javascript code that will
validate if the end user of the javascript has the necessary VML
attributes set in their HTML. The problem in IE is that "xmlns:v"
does not appear in their attributes property or the
getAttribute('xmlns:v') calls. The real kicker is that the 'xmlns'
attribute does return something.
The HTML Snippet would look like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-
microsoft-com:vml" anthony="abc">
<head>
------------------------
var htmlElement = window.top.document.getElementsByTagName("html")[0];
//Returns "http://www.w3.org/1999/xhtml" Expected "http://www.w3.org/
1999/xhtml"
var validAttr = htmlElement.getAttribute('xmlns');
//Returns "" Expected "urn:schemas-microsoft-com:vml"
var badAttr = htmlElement.getAttribute('xmlns:v');
------------
Does anyone have any suggestions for how to either get this value, or
perhaps another way to validate that the VML ns has been installed?