For some reason I can’t work out in IE7 I get a script error when the page loads. I have stripped everything out except the vbscript block that detects the plugin to isolate the problem.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<script language='VBScript'>
function detectUnityWebPlayerActiveX
on error resume next
dim tControl
dim res
res = 0
set tControl = CreateObject("UnityWebPlayer.UnityWebPlayer.1")
if IsObject(tControl) then
res = 1
end if
detectUnityWebPlayerActiveX = res
end function
</script>
</head>
<body>
<button onclick="alert('here');">test</button>
</body>
</html>
All I’m doing to create the error is to add any html element with an onclick event.
I think it has something to do with IE thinking the event is server side perhaps?
Works fine in firefox.
I would like to embed the unity3d plugin in a website, but cant get psat this error.
on error resume next
dim unityControl
set unityControl = CreateObject("UnityWebPlayer.UnityWebPlayer.1")
If (IsObject(unityControl)) Then
unityFound = 1
Else
unityFound = 0
End If
results in unityFound being 0
but the regular code does pretty much the same thing, only difference is that it’s called as a function rather than being set as the page loads.