Oli R.
Oli R.

Reputation: 73

[three.js]: script running in IE10, not running as HTA

I am coding an offline HTML application and discovered that three.js would be a nice library to work with (Win7, IE10).

I tested several example r59 scripts (that hold the functionality I would love to use) within IE10 and they worked fine.

These scripts are:

"css3d_periodictable.html" and "canvas_particles_random.html"

But when renaming these example scripts from ".html" to ".hta" (The whole coding project is an HTA project), then the same (otherwise unaltered) example scripts throw errors and do not work.

Since this is nothing that I normally experience, it seems to me that the library depends on some IE functionality that is dropped with MSHTA.EXE...

My question: Is this something that can be fixed (browser checking conditions, f.e.) or some core functionality that is missing as HTA?

Thank you in advance for your help.

Oliver

Upvotes: 2

Views: 1705

Answers (1)

Oli R.
Oli R.

Reputation: 73

Okay, problem understood... solution is tricky.

When using Three.js code within an HTML application (HTA), then the HTA uses IE7 quicks mode by default. You can easily add the following line to the Three.js HTA:

<meta http-equiv="X-UA-Compatible" content="IE=IE10" />

But then, no more HTA mark-up is understood (windowstate, applicationname - to mention just a few) since the MS IE team wants to "focus more on standards" :-(

But there is a trick which works...

Create an empty HTA using all the mark-up code that you like, for example:

<hta:application windowstate="minimize" border="none" icon="myIcon.ico" />

Do NOT use the IE10 X-UA-Compatible meta statement here.

Create an onload javascript function within that HTA that loads the THREE.js HTML page to document.location.href

as described here (social.msdn.microsoft.com)

The HTML page should contain all the THREE.js code and the meta statement (see beginning of this post). Works like a charm.

Thank you to Teemu for pointing me into the right direction!

Upvotes: 2

Related Questions