[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 297
  • Last Modified:

html(xhtml)/javascripts behave different between browsers


I have a web-application with javascripts it behaves differeent between IE and fireFox.
This one works on fireFox but not on internet explorer (IE)

http://cs330.blueearthconnections.org/Ze/Assignment_03/fractal_online.html

You can play with it by entering  0  0   300  300;  beta: 0.3 ;  angle: 35 ;
level of recursion: 4; color: red  ;   It suppose to draw a tree

But this one with slight modification works on both IE and fireFOX browers

http://cs330.blueearthconnections.org/Rochelle/Fractal.html

Experts, could you help me explain the difference? Obviously I hope it works  trasparently across all broswers.

Thanks
0
zzhang2006
Asked:
zzhang2006
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
The major browsers each have their own implementation of javascript and each one is slightly different.  The major families are IE (internet Explorer), Firefox/Mozilla, and Webkit which is used by Safari and Chrome.

http://cs330.blueearthconnections.org/Rochelle/Fractal.html is not working in Firefox.  The Error Console says that "levelInput is Null".
0
 
dsmileCommented:
I don't know what exactly problem is, but I think DOCTYPE prevents your code from working.

Remove this line from your page and you'll see it work

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

If you want to keep this DOCTYPE declare then I suggest you to dig deeper into this cause, or just simply remove it
0
 
zzhang2006Author Commented:
Removing the DOCTYPE solved the problem, at least for the two broswers. Thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now