robaldo
10-07-2016, 03:59 PM
Hi there,
a dumb question with "eval" function. I found inside script "hangman II" this line:
wrong_guesses += 1;
eval("document.hm.src=\"hm" + wrong_guesses + ".gif\"");
That shows the gif images url-of-the-page-where-script-is-displayed/hm1.gif
or
url-of-the-page-where-script-is-displayed/hm2.gif
or
url-of-the-page-where-script-is-displayed/hm3.gif
etc.
If the script (js + images) is installed in another directory (on the same domain) how can I change that line to be something like
url-of-directory-where-are-stored-js-and-images/hm1.gif
or
url-of-directory-where-are-stored-js-and-images/hm2.gif
etc?
Thank you in advance!
a dumb question with "eval" function. I found inside script "hangman II" this line:
wrong_guesses += 1;
eval("document.hm.src=\"hm" + wrong_guesses + ".gif\"");
That shows the gif images url-of-the-page-where-script-is-displayed/hm1.gif
or
url-of-the-page-where-script-is-displayed/hm2.gif
or
url-of-the-page-where-script-is-displayed/hm3.gif
etc.
If the script (js + images) is installed in another directory (on the same domain) how can I change that line to be something like
url-of-directory-where-are-stored-js-and-images/hm1.gif
or
url-of-directory-where-are-stored-js-and-images/hm2.gif
etc?
Thank you in advance!