+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Help with Javascript

  1. #1
    souradipm is offline x10Hosting Member souradipm is an unknown quantity at this point
    Join Date
    Jun 2008
    Posts
    45

    Help with Javascript

    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

  2. #2
    Jake's Avatar
    Jake is offline Developer Jake is an unknown quantity at this point
    Join Date
    Apr 2005
    Location
    Winona, MN
    Posts
    2,084

    Re: Help with Javascript

    well first thing you forgot ; 's on 2 of the functions you called in the javascript....
    Jake Omann | Developer
    █ 888-X10-9668 - jake[@]x10hosting.com
    x10Hosting - Giving Away Hosting Since 2004
    Premium Hosting | VPS Services

  3. #3
    souradipm is offline x10Hosting Member souradipm is an unknown quantity at this point
    Join Date
    Jun 2008
    Posts
    45

    Re: Help with Javascript

    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 by souradipm; 10-29-2008 at 10:18 AM.

  4. #4
    Jake's Avatar
    Jake is offline Developer Jake is an unknown quantity at this point
    Join Date
    Apr 2005
    Location
    Winona, MN
    Posts
    2,084

    Re: Help with Javascript

    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 by Jake; 10-29-2008 at 10:26 AM.
    Jake Omann | Developer
    █ 888-X10-9668 - jake[@]x10hosting.com
    x10Hosting - Giving Away Hosting Since 2004
    Premium Hosting | VPS Services

  5. #5
    souradipm is offline x10Hosting Member souradipm is an unknown quantity at this point
    Join Date
    Jun 2008
    Posts
    45

    Re: Help with Javascript

    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

  6. #6
    Jake's Avatar
    Jake is offline Developer Jake is an unknown quantity at this point
    Join Date
    Apr 2005
    Location
    Winona, MN
    Posts
    2,084

    Re: Help with Javascript

    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.
    Jake Omann | Developer
    █ 888-X10-9668 - jake[@]x10hosting.com
    x10Hosting - Giving Away Hosting Since 2004
    Premium Hosting | VPS Services

  7. #7
    souradipm is offline x10Hosting Member souradipm is an unknown quantity at this point
    Join Date
    Jun 2008
    Posts
    45

    Re: Help with Javascript

    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

  8. #8
    natsuki's Avatar
    natsuki is offline x10 Sophmore natsuki is an unknown quantity at this point
    Join Date
    Sep 2008
    Posts
    112

    Re: Help with Javascript

    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 by natsuki; 10-29-2008 at 02:48 PM.

  9. #9
    souradipm is offline x10Hosting Member souradipm is an unknown quantity at this point
    Join Date
    Jun 2008
    Posts
    45

    Re: Help with Javascript

    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

  10. #10
    dickey's Avatar
    dickey is offline x10 Sophmore dickey is an unknown quantity at this point
    Join Date
    Sep 2008
    Location
    Singapore
    Posts
    128

    Re: Help with Javascript

    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.
    Don't get me wrong as I believe if and when I help someone I also help myself whereby whatever someone learns I also learn.

    But I will also accept credits or reps if you really want to part with it.

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Making a site JavaScript dependent - pros/cons?
    By Tarzan in forum Programming Help
    Replies: 8
    Last Post: 07-11-2008, 10:08 AM
  2. drop down menus with JavaScript disabled?
    By sifaka in forum Free Hosting
    Replies: 1
    Last Post: 05-15-2008, 10:46 AM
  3. javascript and external javascript files problem
    By delon in forum Programming Help
    Replies: 6
    Last Post: 04-27-2008, 12:41 AM
  4. A question about javascript files
    By rlodge in forum Programming Help
    Replies: 6
    Last Post: 12-19-2007, 11:26 AM
  5. XML and Javascript
    By cuteboytm in forum Graphics & Webdesign
    Replies: 1
    Last Post: 09-21-2007, 10:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers