I am implementing javascript in birt to check the os of the machine as I am making a responsive report.
Here is my javascript
if(navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i)){
var a = document.getElementsByTagName('svg');
var i =0;
for (i = 0;i< a.length;i++)
{
a[i].style.width = '384px';
}
a = document.getElementsByTagName('embed');
i =0;
for (i = 0;i< a.length;i++)
{
a[i].width = '384px';
a[i].initialWidth = '384px';
}
}
It gives me following error when I load it on the browser
ReferenceError: "navigator" is not defined. (/report/method[@name="beforeRender"]#1)