Piwik XHTML Opera issues

I’m quite new to Piwik and I have a problem adding the JavaScript to my XHTML web application.
I used the example code given on www.piwik.ork/xthml and it does work in my Firefox browser.
Sadly the application has to run on Opera and when I try to open the website the Opera browsers debug tool “Dragonfly” gives me the following error:
“Unhandled DOMException: INVALID_STATE_ERR” when trying to execute

I googled for this issue and found out that Opera does not allow functions like document.write(), document.body() but only DOM functions like getElementById when using “XHTML 1.0”.

How can I add the tracking code to my application. I really like Piwik but this is a big problem for me.

Use the latest version of Piwik. Go to Settings > Tracking code. Copy the code there, it does not use document.write.