javascript - Google Drive - Providing resource paths -
i have created hangman game in html , javascript.
when run on local machine, works perfectly. happens when user loses game image called lose.png
displayed. if user wins image win.png
displayed.
moreoever, other images need displayed displayed fine. 2 images need displayed @ end of game not displayed.
but when uploaded google drive , tried play there, other parts fine last image change win.png
or lose.png
not take place.
the complete code available here - hangman.
the part of code not work is:
if(score === wordis.length) { document.getelementbyid("respimg").setattribute("src","img/win.png"); alert("you won game!!\na new game has been started."); return true; } if(attrem <= 0) { document.getelementbyid("respimg").setattribute("src","img/lose.png") alert("your attempts over.\nyou lost game.\nthe word trying guess was:\"" + wordis + "\""); return true; }
in above code:
attrem
number of attempts remainingwordis
word guessed user
note alert statements working fine. image not change when file run google drive.
but when run on local machine, image changes.
the html file can viewed here - main
this html file uses twitter bootstrap. don't think ties in issue i'm facing.
open javascript console in web browser of choice. errors - it's obvious haven't corrected paths (i.e. uris) of resources.
this find errors in chrome console:
error -
failed load resource: server responded status of 404 (not found) https://googledrive.com/host/0b7m-r5goz6cvymqwagnkac1xm1k/js/twitter-bootstrap-2.2.2/bootstrap.min.js
Comments
Post a Comment