danishgoel / box2dweb

Automatically exported from code.google.com/p/box2dweb
0 stars 0 forks source link

Broken in IE9 #23

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run IE9
2. Go to http://code.google.com/p/box2dweb/

I made a game using this and testing in Chrome and was devastated to find - 
after making the game - that it doesn't work in the (admittedly awful but) most 
common browser on the planet.  

Nowhere on the main page does it say that it doesn't work in IE9.  Please 
change the title page to inform would-be developers to steer clear of it until 
it works to avoid future heartache.  eg. "works in modern browsers, does not 
work in IE"

I would be eternally grateful if a fix was made to account for the very minor 
errors experienced in IE.  I absolutely love box2dweb - you are awesome.

P.S.  The engine DOES work wonderfully and at 60fps on my Android phone!  Great 
work!

Original issue reported on code.google.com by breakdan...@gmail.com on 22 Aug 2011 at 6:30

GoogleCodeExporter commented 9 years ago
Incidentally, I wanted you to know that your efforts are greatly appreciated 
and I'm in awe of your skills.  I'm happy to help with testing, enthusiastic 
encouragement, and forgive the "most common browser on the planet" comment - I 
admit that this is likely not true as the most common is probably IE6 or 
something horrible. =)  I personally never use IE but half my users tell me my 
game is broken which is terribly depressing.

Original comment by breakdan...@gmail.com on 22 Aug 2011 at 6:35

GoogleCodeExporter commented 9 years ago
Hi,

I'm sorry, I haven't been here for a while. IE9 support should / must work. I 
tried to reproduce the problem, but I don't see any problems with IE9 and the 
Box2dWeb demo. Are you using an outdated version of IE9? Is your game using an 
outdated version of Box2dWeb? 

As for your compliments - thank you very much, but keep in mind that my work is 
the AS3 to JS compiler, the great physics engine itself was developed by Erin 
Catto.

Original comment by Uli.He...@googlemail.com on 29 Aug 2011 at 11:10

GoogleCodeExporter commented 9 years ago
Thanks for the reply!  I am using IE (v.9.0.8112.16421) on Win Vista 32 bit.  
The current demo at http://code.google.com/p/box2dweb/ breaks IE with a bunch 
of errors 

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/5.0; 
SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 1.1.4322; .NET CLR 
3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C)
Timestamp: Mon, 29 Aug 2011 15:58:11 UTC

Message: Object doesn't support property or method 'defineProperty'
Line: 51
Char: 453
Code: 0
URI: http://box2dweb.googlecode.com/svn/trunk/Box2d.min.js

but - and here's the great news: I was able to hunt down version r21 
(http://code.google.com/p/box2dweb/source/detail?r=21) and it DOES work with 
IE9.  Therefore, I must assume that your demo is using either an older version 
OR a newer one that accidentally broke IE.

In any case I would never, ever choose to use IE, nor would any gamer, but I 
wanted the game to "just work" for everyone including people who are 
non-tech-savvy.  Don't worry too much about IE - it is the bane of the internet 
and needs to be destroyed.

In any case, I will simply never deviate from using r21 and will lock it down 
as the version I need to use for my games now and in the future.

Keep up the WONDERFUL WORK!  You rock.

P.S.  I have a lot of as3 code that I would like to convert to JS.  I would be 
grateful if you'd kindly post a link to your code conversion utility here as 
this would be very handy (even if it does an incomplete job and needs manual 
edits to get larger codebases working in JS it would save me a lot of time).

Thanks again!  You are awesome!  =)

Original comment by breakdan...@gmail.com on 29 Aug 2011 at 3:53

GoogleCodeExporter commented 9 years ago
Hi, thanks for your efforts.

But also revisions newer than r21 should work. I think "not updating" is a bad 
solution, since other problems will be fixed in newer versions and performance 
improvements are currently under developement.

The diff between r21 and r24 shows changes which aren't related to the 
IE9-problem. I also wonder why you get the "Object doesn't support property or 
method 'defineProperty'-message, since defineProperty is used in later 
revisions as well. I even searched for "Object.definedProperty" in both files 
and found it.

http://box2dweb.googlecode.com/svn-history/r21/trunk/Box2d.min.js
http://box2dweb.googlecode.com/svn/trunk/Box2d.min.js

The only idea I have: Your IE9 is maybe switched to compatibility mode on the 
Box2dWeb page. Can you verify that? Just hit F12 - the  developer tools-window 
appears. You can see combo boxes at the top with labels "browser mode" and 
"document mode". Please make sure that both are set to "Internet Explorer 9".

I'm sorry, but I can't publsih the compiler at the moment. It's in a horrible 
state since I made some design mistakes. Later, quick bug-fixes made it even 
worse. I'm currently working on that. But I'm very busy whereby development 
progress is very slow. I'll release it at soon as this work is done.

Thanks for your compliments again ;)

Original comment by Uli.He...@googlemail.com on 29 Aug 2011 at 4:48

GoogleCodeExporter commented 9 years ago
You are awesome!  You are correct: IE9 goes into stupid "IE8 standards" 
compatibility mode on code.google.com but even r30 works great on my game if I 
set the doctype of the page:

<!DOCTYPE html>

My game html now reports in the F12 menu: "document mode: IE9 standards".
... and magically everything works great!  

Sadly, in viewing source of the google code page it also uses this doctype.  So 
I'm stumped and have no idea why the demo page is tricking IE9 into going into 
IE8 mode... but regardless this is the issue.

Great idea and good catch.  This would be very helpful for developers as 
something to put right on the front page, since the demo doesn't work but a 
custom standards compliant html page does.  Tell users to force IE9 to go into 
IE9 mode so they don't give up like I did.

Original comment by breakdan...@gmail.com on 30 Aug 2011 at 12:07

GoogleCodeExporter commented 9 years ago
This is the final solution to fix IE9:

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

Now box2dweb will always work in all versions.

Original comment by breakdan...@gmail.com on 30 Aug 2011 at 12:14

GoogleCodeExporter commented 9 years ago
"Sadly, in viewing source of the google code page it also uses this doctype.  
So I'm stumped and have no idea why the demo page is tricking IE9 into going 
into IE8 mode... but regardless this is the issue."

As I said - I don't see that problem on the demo page when using my computer. 
But I will add that note.

If "<!DOCTYPE html>" works why do you need "<meta http-equiv="X-UA-Compatible" 
content="IE=9" >"

Thanks for your contributions :)

Original comment by Uli.He...@googlemail.com on 31 Aug 2011 at 9:42

GoogleCodeExporter commented 9 years ago
Unfortunately "<!DOCTYPE html>" does not work in all cases (IE sucks, as we all 
know) - for example, that is the doctype of code.google.com but 
http://code.google.com/p/box2dweb/ does NOT work (multiple error messages in 
IE9 on my computer) so the only way to FORCE IE9 to act like IE9 is to tell it 
to do so.  

The only reliable solution to avoiding IE errors that I have found is this meta 
tag: 

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

This is because IE9 uses a really complex and stupid heuristic to "guess" 
whether it should pretend to be IE7 or IE8 depending on the content of the html 
but as we know box2dweb ONLY works in IE9 and beyond.  The meta tag is 
mandatory - the doctype is just recommended (and happened to work in my simpler 
html page without the meta tag because my html was different).  If your html 
has both the doctype and the meta tag, it should (hopefully) work for all users.

With this in mind, it would be great if http://code.google.com/p/box2dweb/ 
could be made to work.  =)  You might not be able to tweak googlecode's html...

Oh Internet Explorer - why do you hate programmers so much?

Original comment by breakdan...@gmail.com on 31 Aug 2011 at 10:24

GoogleCodeExporter commented 9 years ago
Just for fun, this was the game I made:

http://www.mcfunkypants.com/LD21/

Original comment by breakdan...@gmail.com on 31 Aug 2011 at 10:33

GoogleCodeExporter commented 9 years ago
I can confirm this problem. My app doesn't work in IE9.
I tried to only have one line which include the library in html head tag, this 
also causes error in the library.
The demo.html and the example.html files came with the zip package doesn't even 
work in my IE9.
I will try the meta tag today.

This is my screenshot of my IE9 error. I am running in IE9 mode not compatible 
mode.
http://i52.tinypic.com/3128bo3.png

Original comment by gladiacx...@gmail.com on 10 Sep 2011 at 11:34

Attachments:

GoogleCodeExporter commented 9 years ago
<!DOCTYPE html> does the job for ie. I have also included excanvas.js 

Original comment by muhammed...@gmail.com on 3 Nov 2011 at 4:01