On Mar 27, 11:30 pm, "Yansky" <forbo...@gmail.com> wrote:
> This is my current code at the
> moment:
>
> var theTextofStyle = document.createTextNode('v\:* { behavior:
> url(#default#VML); }');
> document.getElementsByTagName('style')[0].appendChild(theTextofStyle);
>
> I've tried all the usual ways to escape the backslash, but IE still
> won't let me write it into the style element.
>
> Anyone have any ideas on getting around this?
Yes, I do. But just a year ago I would stay silent as it was the
biggest capitalization for myself out of simply reading producer
specs

Now the retaining period is over. I am not saying that
I'm the only one who can read MSDN, but in this particular case it
seemed so for all the time of my interest.
First get rid of all this stuff you posted.
Now:
// missing namespaces return null
if (document.namespaces.item('v') == null) {
// then adding the required namespace/behavior combo:
document.namespaces.add('v', 'urn:schemas-microsoft-com:vml',
'#default#VML');
}
// now you can draw whatever you want using VML
The page itself stays "clean" in the sense that you don't add any IE-
specific attributes into <html> or <style>