Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 2 FirstFirst 12
Results 16 to 28 of 28
  1. #16
    New Coder
    Join Date
    Oct 2012
    Posts
    55
    Thanks
    26
    Thanked 0 Times in 0 Posts
    There are SO MANY problems (converting my site for GC), the time it would take to fix them all would be enormous (my site is huge, it has everything from complex movable obeject scripts to player wallets, rewards, slideshows, an incredibly complex draw-card system, player wallets, rediculously large image map scripts that change on mouseovers, a floating calculator that is also draggable, many many popup's, floating navigation menu, and endless graphical and css tricks - and let's not forget about my ancient coding skills - that complicates things further).

    I might be better off trying to eliminate the 'seemingly random' Runtime error I get a few hours into playing the game, and just forget about a save feature altogether. If I can crack that runtime error, there would be no real need to implement a save feature, because the browser wouldn't lock up on the user.

    My skills in error-checking are not great at all, but that runtime error is the ONLY error I get running my site OFFLINE, IN IE9, WITHOUT A DOCTYPE.

    How can I determine that Runtime error? I have no experience with runtime errors. I DID however re-study variable-types (how they're created, where they should be, Global, Local, etc.) because I read that using variables incorrectly can lead to runtime errors. So now all my variables seem to conform to how they're supposed to be. I need to go study how to check runtime errors again, see if I missed something.

    Is there any programs you know of that can check for runtime errors?

    ps. is IE9 ever going to change the way they handle 'data storage'? Will they ever make it like it was in IE8 or in Google Chrome? Anyone know?
    Last edited by Mindphaser; 04-06-2013 at 06:13 PM.

  2. #17
    New Coder
    Join Date
    Oct 2012
    Posts
    55
    Thanks
    26
    Thanked 0 Times in 0 Posts
    Ok... this is embarrassing, but after 10 years of never using the debugging tool in my old 'Homesite' editor, I finally learned once again, that it exists! lol

    So I ran it on my site, and immediately saw a number of errors.

    But the first error, I'm not sure what the debugger is saying:

    <bgsound src="#" id="soundeffect" loop=1 autostart="true"></bgsound>


    <!-- Start WOWSlider.com HEAD section -->
    <link rel="stylesheet" type="text/css" href="engine1/style.css" media="screen">
    <script type="text/javascript" src="engine1/jquery.js"></script>
    <!-- End WOWSlider.com HEAD section -->

    (This IS in the header, however the debugger says:

    -- the tagname 'bgsound' not found in currently active versions


    Any ideas how to go about fixing this?
    Last edited by Mindphaser; 04-06-2013 at 07:21 PM.

  3. #18
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,732
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Quote Originally Posted by Mindphaser View Post
    Ok... this is embarrassing, but after 10 years of never using the debugging tool in my old 'Homesite' editor, I finally learned once again, that it exists! lol

    So I ran it on my site, and immediately saw a number of errors.

    But the first error, I'm not sure what the debugger is saying:

    <bgsound src="#" id="soundeffect" loop=1 autostart="true"></bgsound>


    <!-- Start WOWSlider.com HEAD section -->
    <link rel="stylesheet" type="text/css" href="engine1/style.css" media="screen">
    <script type="text/javascript" src="engine1/jquery.js"></script>
    <!-- End WOWSlider.com HEAD section -->

    (This IS in the header, however the debugger says:

    -- the tagname 'bgsound' not found in currently active versions


    Any ideas how to go about fixing this?

    bgsound is proprietary to Internet Explorer. This element is a Microsoft invention and not in any W3C standard and is only supported by Internet Explorer. Use the <audio> element instead. I suspect that you will need to devote quite a lot of time and effort bringing your code up to date.

    You trap runtime errors with try/catch. see http://www.javascriptkit.com/javatutors/trycatch.shtml
    Last edited by Philip M; 04-06-2013 at 07:45 PM.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  4. Users who have thanked Philip M for this post:

    Mindphaser (04-06-2013)

  5. #19
    New Coder
    Join Date
    Oct 2012
    Posts
    55
    Thanks
    26
    Thanked 0 Times in 0 Posts
    This is a long shot here but is there any way of coding a site so that a specific popup html page opens when the mainpage suffers from a random runtime error?

    My current save option (because my coding skills suck), is that a popup page opens up with all the form variables (from the game) displayed in plain text for copying and pasting into a text editor. Then when I need to bring up that game again, I fill in the form by reading the saved text document. I know it is quite laughable, but it's really the only laughable thing about my game.

    Suffice to say, because of this rediculous saving 'feature', if I get a random runtime error a few hours into playing, and I havent updated my 'save document', then I've lost a bunch of info.

    That's why I was thinking, if I could have that save-game popup window open when a runtime error occurs, then I'd at least be able to do another copy/paste of the form data from that popup.

    ps. I took a quick look/try with the runtime error checking stuff you directed me to. Was having troubles implementing it and it may be a bit too confusing for me (it is TRLUY hilarious some of the things I don't know about coding, when you consider some of the trickier things I DO know), but either I'm having a bad day concentrating, or I can't figure out the try{ methods

    so, in the meantime (and because I'm anxious to get back to playtesting my game), do you know if what I asked above is 'doable'?

    And thanks too for all your help.

  6. #20
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,732
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Quote Originally Posted by Mindphaser View Post
    This is a long shot here but is there any way of coding a site so that a specific popup html page opens when the mainpage suffers from a random runtime error?
    Yes, there is.

    Code:
    <!DOCTYPE html>
    <html>
     <head> 
    </head>
    
    <body onload = "message()">
    
    <script type = "text/javascript">
    
    var txt = "";
    function message() {
    try  {
    alllert ("Welcome guest!");
    }
    catch(err)   {
    txt = "There was an error on this page.\n\n";
    txt += "Error description: " + err.message + "\n\n";
    txt += "Click OK to continue.\n\n";
    alert (txt);
    
    window.open('http://www.mysite.com','','width=800,height=600,toolbar=yes,resizable=yes,location=yes,directories=yes,status=yes,menubar=yes,scroll=yes,titlebar=yes')
    }
     
    }
    </script>
     
    </body>
    </html>
    This thread seems to run and run. Have you tried using Google? And have you tried using your error console to identify the "random runtime error" (which sounds to me like a random number generated out of range every so often - perhaps by using Math.ceil rather than Math.floor).
    Last edited by Philip M; 04-07-2013 at 10:40 AM.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  7. Users who have thanked Philip M for this post:

    Mindphaser (04-07-2013)

  8. #21
    New Coder
    Join Date
    Oct 2012
    Posts
    55
    Thanks
    26
    Thanked 0 Times in 0 Posts
    First off PM... thanks so much. With that error catching code, if I can't eliminate the runtime error, at least I have that.

    You ask if I've used google, do you mean 'for finding out solutions'? I have been doing that endlessly for many problems I've encountered with my site over the past 6 years, with many good results. And I'm STILL googling around for this particular problem. But... as you know, googling for answeres doesn't always work (most of the time, but not always). But there is still MORE googling to be done here with these runtime errors.

    After 6 years, I FINALLY remembered the validation option in Macromedia's Homesite. So I ran it yesterday. Unfortunately, it has problems with stuff like this (a snippet from my complex image-map mouseover img swap script):

    Code:
    <a href="" onMouseOver="document.France_TXT.src='images/France_over.png';"
    			onClick="document.Europe_Front.src='images/pc_21.jpg';document.Europe_Flag.src='images2/Backgrounds_BTTM_LEFT_Deeds_Area_Europe_05.jpg';"
    			onMouseOut="document.France_TXT.src='images/France_up.png';">
    <area name="FRANCE - $265" shape="poly"
       OnMouseOver="mouseover3('Europe_Map_France');window.defaultStatus=''; window.status='FRANCE\''; return true"..." OnMouseOut="mouseover3('Europe_Map_Default')"
       coords="399,391,405,398,409,394,412,379,407,379">
    </a>
    The problem my validator has is that once it hits the single-quotes, it can't read and validate the rest of my page properly. It sees every character as an 'issue'. I could CUT those image maps out and then run it, but hopefully I can avoid that, as there are 22 LARGE image maps being used on the site.

    But... what really intrigues me about your reply PM, is your mention of Math.floor. I am using math.floor for both my dice rolling and my draw-card decks. What issues are there with Math.floor (I will google), but if you could help me figure out how to clean up my random code, that could solve my runtime error. However I am not using Math.ceil. Here is my random code (for 1 die):

    Code:
    var random=(Math.random()*image.length);
    var r2=Math.floor(random);
    I found this quote from another site, and from it, it would seem that math.floor is more appropriate, as my dice are images used in an array, thus the random needs to access the [0] placeholder in the array, right?

    here's the quote:

    "Random integers are often used to assign array items as values.

    Math.floor(Math.random()*array.length) will return an index between 0 and the largest array index.

    Math.ceil in the same expression will never return array[0] and will occasionally return array[array.length], which is one more than the largest array item, and an error if you don't catch it.

    Suit yourself, but often there is a reason one method is used instead of another"


    ps. I placed your error-catch code in its own js file and linked it in the header section. Is that ok with this code?
    Last edited by Mindphaser; 04-07-2013 at 06:59 PM.

  9. #22
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,732
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Quote Originally Posted by Mindphaser View Post
    here's the quote:

    Math.floor(Math.random()*array.length) will return an index between 0 and the largest array index.

    Math.ceil in the same expression will never return array[0] and will occasionally return array[array.length], which is one more than the largest array item, and an error if you don't catch it.
    That is what I told you.

    Your clock code is just too antiquated to be believed. Internet Explorer 4 and Netscape 6 have long been one with Nineveh and Tyre.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  10. #23
    New Coder
    Join Date
    Oct 2012
    Posts
    55
    Thanks
    26
    Thanked 0 Times in 0 Posts
    Clock code? Not sure what you mean. It does what I need it to do and looks nicer than alot of others I've seen. I've said before my coding skills suck in alot of areas and I can tell you there were code bits I copied from help sites that I can't fully understand. But I got them working for my (I'll say it again... OFFLINE site). I'm not doing any of this for web design greatness as I can never work due to a dissability. It has been a struggle just to finish my site to do final playtesting on my boardgame (which thankfully will make me money, yes I'm that confident... beyond confident actually... to the point of arragance almost - but lets hope I don't go there).

    I'm saying about the random code though, that I DO use floor and not ceil, as I currently understand it, that is the appropriate code to use in my case and wouldn't be the issue I'm having with runtime errors.

    As for Nineveh and Tyre... who and who?

  11. #24
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,732
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Quote Originally Posted by Mindphaser View Post
    Clock code? Not sure what you mean. It does what I need it to do and looks nicer than alot of others I've seen. I've said before my coding skills suck in alot of areas and I can tell you there were code bits I copied from help sites that I can't fully understand. But I got them working for my (I'll say it again... OFFLINE site). I'm not doing any of this for web design greatness as I can never work due to a dissability. It has been a struggle just to finish my site to do final playtesting on my boardgame (which thankfully will make me money, yes I'm that confident... beyond confident actually... to the point of arragance almost - but lets hope I don't go there).

    I'm saying about the random code though, that I DO use floor and not ceil, as I currently understand it, that is the appropriate code to use in my case and wouldn't be the issue I'm having with runtime errors.

    As for Nineveh and Tyre... who and who?

    You posted a horrible clock script in post#15.

    As for Nineveh and Tyre - this is a (well known?) quote from the poem Recessional by Rudyard Kipling.

    Far-called our navies melt away—
    On dune and headland sinks the fire—
    Lo, all our pomp of yesterday
    Is one with Nineveh and Tyre!
    Judge of the Nations, spare us yet,
    Lest we forget—lest we forget!


    Probably seen as a bit politically incorrect these days.
    Nineveh and Tyre were of course Bibical cities which were allegedly destroyed.
    Last edited by Philip M; 04-08-2013 at 07:38 AM.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  12. Users who have thanked Philip M for this post:

    Mindphaser (04-09-2013)

  13. #25
    New Coder
    Join Date
    Oct 2012
    Posts
    55
    Thanks
    26
    Thanked 0 Times in 0 Posts
    Is the clock script REALLY that bad!?

    What's the problem with it?

    This is what I needed it to do:

    - work OFFLINE in IE9 in a page that doesn't use a doctype (having a doctype declaration SHOULD have been done right at the start, I know. Now when I add one, half of my work disappears or stops working)

    - clock needed to 'Not refresh the screen'

    - needed to float while scrolling, to stay with the user (me).

    - needed heavy css applied to it.

    - needed to show hour, minutes, seconds, and AM/PM.

    Check, check, check, check, and check.

    Whats the biggest problem about it PM?

    Is there a better script out there, maybe a more current script, that you'ld suggest?

    Thanks eh.

    ps. I am very soon going to be extremely rich AND famous from my boardgame(though the fame I'm not looking forward to so much, attending award ceremonies and conventions will be a hassle for me if the doctors can't make me better). But understand that I won't forget about those who helped.

    pps. the United Kingdom is a level 7 property (out of 8), for Europe in my game, you'll be happy to know. That's VERY good. And expansion packs will eventually be out there that will let you make the U.K. (or any other country) the top property for that set.

    I mention that because I see you reside there.

    Cheers to PM!
    Last edited by Mindphaser; 04-09-2013 at 07:23 PM.

  14. #26
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,732
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Quote Originally Posted by Mindphaser View Post
    Is the clock script REALLY that bad!?
    No, on second thoughts it is a lot worse than that!

    Try this:-

    Code:
    <html>
    <head>
    
    <style type="text/css">
    
    #Clock {
    	display:block;
    	text-align:left;
    	font-family:Arial,Helvetica,sans-serif;
    	font-weight:bold;
    	font-size:16pt;
    	color:#FF0000;
    	line-height:100%;
    }
    </style>
    
    
    <script type="text/javascript"> 
    
    function startTime() {
    runClock();    // to start right away
    setInterval(runClock,1000);
    }
    
    
    function runClock() { 
    var today = new Date();
    
    var h = today.getHours();
    var h1 = h; 
    var m = today.getMinutes();
    var s = today.getSeconds(); 
    var ampm = " AM";
    
    if (h >= 12) {ampm = " PM"}
    if (h >= 13) {h = h - 12}
    if (h1 == 0) {h = 12}
    
    if (h<10) {h = "0" + h}
    if (m<10) {m = "0" + m}
    if (s<10) {s="0" + s} 
    
    document.getElementById('Clock').innerHTML = h + ":" + m + ":"+ s + ampm; // delete ampm if desired
    
    } 
    
    </script> 
    </head> 
    
    <body onload = "startTime()"> 
    
    <div id = "Clock"></div>
    
    </body>
    </html>
    All Javascript programs should include a DOCTYPE. The reason why half your code stops working is that it only works in obsolete browsers in quirks mode.

    I wish you luck, but I get the idea that you will need to develop much improved coding skills if you are to have any realistic chance of turning your game into a commercial and marketable product. Using long-obsolete code is a no-no!

    "It works for me" - Famous last words of inexperienced web-designer
    Last edited by Philip M; 04-10-2013 at 08:23 AM.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  15. #27
    New to the CF scene
    Join Date
    Mar 2013
    Location
    Jersey City USA
    Posts
    2
    Thanks
    0
    Thanked 1 Time in 1 Post
    How cookies work
    A cookie is nothing but a small text file that's stored in your browser. It contains some data:
    A name-value pair containing the actual data
    An expiry date after which it is no longer valid
    The domain and path of the server it should be sent to

    name-value
    Each cookie has a name-value pair that contains the actual information. The name of the cookie is for your benefit, you will search for this name when reading out the cookie information

    Expiry date
    Each cookie has an expiry date after which it is trashed.
    Domain and path
    Each cookie also has a domain and a path.

    document.cookie

    If I want to set a cookie for this domain with a name-value pair 'ppkcookie1=testcookie' that expires in seven days from the moment I write this sentence, I do

    document.cookie =
    'ppkcookie1=testcookie; expires=Thu, 2 Aug 2001 20:47:11 UTC; path=/'

    First the name-value pair ('ppkcookie1=testcookie')
    then a semicolon and a space
    then the expiry date in the correct format ('expires=Thu, 2 Aug 2001 20:47:11 UTC')
    again a semicolon and a space
    then the path (path=/)


    USE this code:

    function createCookie(name,value,days) {
    if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
    }

    function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
    }

    function eraseCookie(name) {
    createCookie(name,"",-1);
    }

    OR follow link - quirksmode dot org / JS/ cookies dot HTML

  16. Users who have thanked Tasha Thompson for this post:

    Mindphaser (04-12-2013)

  17. #28
    New Coder
    Join Date
    Oct 2012
    Posts
    55
    Thanks
    26
    Thanked 0 Times in 0 Posts
    [QUOTE=Philip M;1327255]
    I wish you luck, but I get the idea that you will need to develop much improved coding skills if you are to have any realistic chance of turning your game into a commercial and marketable product. Using long-obsolete code is a no-no!
    QUOTE]

    Why do I need good coding skills to market my boardgame, when I can just hand my OFFLINE website out to a bunch of friends via usb-stick, they download the files off the stick, and play it OFFLINE on their computer on IE.

    Someday I'll be paying people to code a video game version of my BOARDGAME (as in Monopoly, Risk, Axis & Allies, D & D, etc, etc.).

    PS. Thanks a tonne Tasha for taking the time time show me a working cookie code. I'm going to give it a try tonight.


 
Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •