September 3, 2007

IE7 shows blank page problem

I was going mad when a simple html page with some javascript doesnt show in IE7 whereas working smoothly in FireFox. (ok it is not unusual) IE7 is doing a silly thing that it asks me if I want to run the scripts and when I say yes it shows a blank page with nothing in it. After some googling through the forums, I found the solution to be changing lines

<script src="..." type="text/javascript" />

to

<script src="..." type="text/javascript"></script >

Sound crazy but it works.

7 comments:

Unknown said...

Yes, this has been a bug in IE for a long time (even in 6, so 7 really should have fixed it).

You always need to close script tags the old fashioned (non XHTML) way, to allow for IE's stupidity.

Anonymous said...

Hocam sana bira ısmarlamak istiyorum! Yarım saattir araştırıyorum ben bu niye böyle diye! :)

Tankut Koray said...

:) Yazdıklarımın işe yaradığını bilmek güzel. (Biraya da hayır demem::)))

Anonymous said...

IE does not support XHTML in any way, so it's not surprising.

www.hixie.ch/advocacy/xhtml

Anonymous said...

THANK YOU! But wow that's stupid....

Anonymous said...

Hocam kullanıcı sıfatıyla :) anlamadığım olay şu; ie7 de javascript açık ancak sayfadaki örn. videoyu açmıyor. bir program eksik desem firefox da açmaz değil mi? Sorun browser da olmalı yoksa ben mi atıyorum ??? ( öyleyse kullanıcı cehaleti de :))ama yine de bir çözüm şu kardeşine ... bira ısmarlarım söz :))))

Tankut Koray said...

Valla simdi boyle sorunca birsey demesi cok guc:) Yani kodunu falan gormeden birsey diyemeyecegim. Muhtemelen javascript IE'de duzgun calismiyordur. Tabii video icin javascripti nasil kullaniyorsun bilemiyorum. Herhalde flash player falan kullaniyorsundur. Javascript yerine onun koduna bakabilirsin. FF ile IE farkli taglar kullaniyorlar flash eklemek icin.