VML, createSurface issue, Unexpected call to method or property access

655
1
06-28-2011 11:20 AM
CoreyAlix
Occasional Contributor
Using IE 9 in compatibility mode results in VML loading instead of SVG.  When VML loads, about 1/2 the time I get a failure in createSurface.  The failure is in the createSurface method in vml.js.  The code which fails is the first appendChild:

  r.appendChild(b);

The content of r and b are as follows:

  b.outerHTML "<V:RECT style="WIDTH: 540px; HEIGHT: 498px; TOP: 0px; LEFT: 0px" stroked="f" filled="f">"
  r.outerHTML "<V:GROUP style="POSITION: absolute; WIDTH: 540px; HEIGHT: 498px" coordsize="540 498" coordorigin="0 0">"

The result of the call to appendChild:

  r.appendChild(b) Unexpected call to method or property access.

I've found reference to this error on the dojotookit bug list but not sure if it's related:
http://bugs.dojotoolkit.org/ticket/11240

Any insight much appreciated.  I've been struggling with this compressed API for too many months!
0 Kudos
1 Reply
CoreyAlix
Occasional Contributor
In my case, adding the following seemed to do the trick:

<!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">

It was based on this advice:
http://code.google.com/apis/maps/documentation/javascript/v2/basics.html#XHTML_and_VML
0 Kudos