Help with Javascript

souradipm

New Member
Messages
45
Reaction score
0
Points
0
Hi,
I'm making an isometric game engine in javascript, and it works great in Firefox, but it breaks in IE. Can someone help to get it working in IE, please?

LINK::http://www.fivepointsoft.co.cc/fpIsoEngine.js

I've added in some checks to the browser and added some changes to the style code appropriately, but it doesnt seem to work.

The source of the html file is:
Code:
<html>
<head>
<title>Five Point Iso Engine</title>
</head>
<script type="text/javascript" src="fpIsoEngine.js">
</script>

<body>
<div id="map"></div>
<div id="obj"></div>
<div id='welcomemessage' name='welcomemessage' style='position: absolute; opacity:50; width: 250px; height: 200px; display: none; background: #ddd; border: 1px solid #000; right: 0px; top: 500px'>

<p>Thank you for trying out the Five Point Iso Engine!<br><center><a href="#" onclick="closePopup('welcomemessage')">Close</a></center></p>

</div>
<script type="text/javascript">
<!--
fpIsoInitEngine(0,0,"map","obj");
fpIsoSetTile(2,4,"water.png")
fpIsoRedrawMap()
openPopup('welcomemessage');
// -->
</script>
<noscript>
Error loading the Five Point Iso Engine because Javascript is disabled.
</noscript>
</body>
</html>

Thanks,
souradipm
 

Jake

Developer
Contributors
Messages
4,057
Reaction score
5
Points
0
well first thing you forgot ; 's on 2 of the functions you called in the javascript....
 

souradipm

New Member
Messages
45
Reaction score
0
Points
0
Hi,
Jake, javascript does not require semicolons at the end of functions. I just added them in sometimes due to habit(they are required in C, C++, PHP, etc). They should not actually cause a problem.

A live version of the problem can be found at: http://fivepointsoft.co.cc/iso/

The map renders almost correctly due to the browser checks I recently added, but mouseovers and clicks don't (in IE).

~souradipm
 
Last edited:

Jake

Developer
Contributors
Messages
4,057
Reaction score
5
Points
0
OHHH oh, IC... never remembered if you could or couldn't. Don't do javascript. Anyway I think it looks like a problem with IE and it not running the javascript correctly because it works in opera in mac osx and google chrome...

Anyway, sorry I can't help lol
 
Last edited:

souradipm

New Member
Messages
45
Reaction score
0
Points
0
lol, that's the problem. Thanks for letting me know it works in Opera, but I posted it here because I need it to work in IE. I know already it's a problem with IE and not my script, but most internet users (i.e. the average person who isnt a geek like you or me) use IE because it comes with their pc and therefore i need to fix the bugs in IE.

Thanks anyway,
souradipm
 

Jake

Developer
Contributors
Messages
4,057
Reaction score
5
Points
0
I'm not aware of any javascript issues with IE but I know there are plenty of CSS. The only thing I can think of is somewere in your CSS you are doing something that doesn't work in IE so I'd start by looking there.
 

souradipm

New Member
Messages
45
Reaction score
0
Points
0
In the live example, the mouseovers don't work. It uses a lot of css, so that could be the problem, but I though I fixed that when I used el.style.setAttribute("cssText","blah") instead of el.setAttribute("cssText","blah") - these are what the browser checks I recently added do.

Thanks for your help, but it hasn't solved the problem yet, so if you or anyone else could help by looking at any css/js bugs in the code, please do so.

~souradipm
 

natsuki

New Member
Messages
112
Reaction score
0
Points
0
It's probably some CSS related IE thingy as usual... Your script works I'm using FF. Your code is kinda long I dunno if I have the time to look at it..

This is what it says in IE (typed it out):

Line: 307
Char: 2
Error: 'myPopupRelocate' is undefined
Code:0
URL: http://fivepointsoft.co.cc/iso/
Hope I could have been able to copy/paste the error instead. >_<
 
Last edited:

souradipm

New Member
Messages
45
Reaction score
0
Points
0
Hi,
Yeah, I use Firefox too. It IS the CSS bugs in IE popping up, because it works in everything apart from IE. That error doesnt hinder the game in any way, its just that dhtml popup thing. I'll fix that after I have fixed the IE bugs. However, can anyone find what is wrong in my code, please?

~souradipm
 

dickey

New Member
Messages
128
Reaction score
0
Points
0
try to use a doctype in your html, sometimes it can help you enable cross-browser compatibility. The isometric game is quite a good idea.
 

souradipm

New Member
Messages
45
Reaction score
0
Points
0
Hi,
Dickey, thanks for your suggestion, but after adding the doctype and adding px's to the css, it hasnt made much of a change. I have also fixed that popup bug. It is not in the version on the webserver, but it hasn't solved the IE compatibility problems. Thanks anyway for your help, and I'm sure my engine is more... standards compliant.
Thanks for the compliment too!

Anyways, please try and see if anything else in the code breaks the code in IE.
Thanks,
~souradipm
 
Last edited:
Top