Hi all, I'm trying to get the below javascript game (a pelmanism game) working without much luck and I'm not seeing the error. Locally, the game works fine, but once uploaded, there's a problem with the code used to call the img files through - and I can't hunt it down. The index page makes a call through javascript to a one player or two player game which I can't make work online. If I launch loader.htm or pairs.htm from the /private/ folder, both initially load, but fail to call any img files. This file size and length is short, and while I was hoping to have it uploaded for a class on Monday, I'm now curious how to make it work. I hope that somebody else, who's interested in solving simple coding problems, can help me with this and I'm keen to learn. I hope I've explained this well enough The online example is below. I've attached the zipped game. http://www.mandytw.com/pairs/index.htm This loads index.htm which in turn should load http://www.mandytw.com/pairs/private/loader.htm which loads. http://www.mandytw.com/pairs/private/pairs.htm Thanks to anyone who has a minute or two to take a look. Steve
From the live links you gave I could see some console errors. Have you looked into what could be causing them?
Hi HuggyStudios, Not sure how to trouble shoot them. If there's a quick way to do so, then it's worth it. Otherwise, I don't have time to keep going over this with a fine-tooth comb. Already spent a number of hours uncommenting and changing absolute and indirect links to make the img call function work, (or just the loader file work!) Thanks for taking a look! STeve
Well you need to fix the JavaScript errors as this whole site is relying on JavaScript to function and that's crashing due to the errors. I've checked the links and they are fine for the images. Unpacked code: function load(f) { file = "private/loader.htm?" + f; winwidth = 660; winheight = 536; wposx = 0wposy = 0; new_window = window.open(file, "fp", "status=no,resizable=yes,toolbar=no,scrollbars=no,screenX=" + wposx + ",screenY=0,left=" + wposx + ",top=" + wposy + ",width=" + winwidth + ",height=" + winheight); } Code (markup): window.focus(); y = 150; left = 180; barx = left; players = eval(location.href.split("?")[1]) newfile = 'pairs.htm?' + players; cellwidth = 12; pictot = 24 + 4; mx = pictot * cellwidth; cells = pictot - 1; tabwidth = cells * cellwidth; str = '<table border="0" cellpadding="0" cellspacing="0" width="' + tabwidth + '" height="12" bgcolor="#000000"><tr><td><img name="strip" src="blank.gif" width="' + tabwidth + '" height="12"></td></tr></table>'; str2 = '<img src="bar.gif" width=2 height=12>'; document.write('<div id="blurb" STYLE="position:absolute;left:' + left + ';top:' + y + ';width:100;height:20;z-index:100;"><span class="bodytext">Loading...</span></div>'); document.write('<div id="block" STYLE="position:absolute;left:' + left + ';top:' + (y + 18) + ';width:' + tabwidth + ';height:12;z-index:100;">' + str + '</div>'); document.write('<div id="bar" STYLE="position:absolute;left:' + barx + ';top:' + (y + 18) + ';width:' + tabwidth + ';height:12;z-index:110;">' + str2 + '</div>'); document.write('<div id="blurb2" STYLE="position:absolute;left:' + left + ';top:' + (y + 100) + ';width:300;height:20;z-index:100;"><span class="bodytext">If nothing happens after a few minutes, <a href="javascript:load2()" class="bodytext">click here</a></span></div>'); document.write('<div id="piccies" STYLE="position:absolute;left:' + left + ';top:-10;width:400;height:10;z-index:100;">'); document.write('<img src="bar.gif" width=1 height=12>'); for (j = 1; j < 13; j++) { document.write('<img name="a' + j + '" src="../cards1/card' + j + '.' + filetype + '" width=1 height=1>'); document.write('<img name="b' + j + '" src="../cards2/card' + j + '.' + filetype + '" width=1 height=1>'); } document.write('</div>'); checkpics(); function checkpics() { tally = 0; for (count = 0; count < (pictot - 1); count++) { if (document.images[count].complete) tally++; } tx = tally * cellwidth; str = '<img src="bar.gif" width=' + tx + ' height=12>'; write_to_div("bar"); window.status = tx + " " + tally + " " + pictot; if (tally < (pictot - 1)) setTimeout("checkpics()", 500); else setTimeout("load2()", 100); } function load2() { location.href = newfile; } function movediv(divName, leftx, topy) { eval('document.getElementById("' + divName + '").style.top=topy'); eval('document.getElementById("' + divName + '").style.left=leftx'); } function write_to_div(divName) { eval('document.getElementById("' + divName + '").innerHTML=str'); } Code (markup):