Why does my jsfiddle work but not my web site? [cl

2019-01-26 02:24发布

I'm not sure what im missing here

I have the following JS fiddle:

http://jsfiddle.net/thetylercox/eeMva/3/

And the site:

http://soldbybillcox.com/treasure/demo1.html

I'm not sure what I am missing but my website does not work.

5条回答
Ridiculous、
2楼-- · 2019-01-26 03:04

Just before your closing </script> tag, you've got an illegal character. Try right-clicking and 'view-source' in Chrome. You'll see it. Line #68.

查看更多
Lonely孤独者°
3楼-- · 2019-01-26 03:20

Seems to work just fine, except you have a random trio of symbols at the end of your <script>, so remove those and it should be just fine.

查看更多
Juvenile、少年°
4楼-- · 2019-01-26 03:25

Open up your console, it says: Uncaught SyntaxError: Unexpected token ILLEGAL, demo.php:68

    ...
    var total1 = document.getElementById("total1").value = total;

}​

These might be caused by a BOM if you're using different files/includes to generate the output. Otherwise, it might just be some copy/paste error. Just remove the }​</script> to make sure the 'invisible' chars are gone between } and < and then type }</script> again and be done with it.

查看更多
疯言疯语
5楼-- · 2019-01-26 03:30

​ from copying and pasting from fiddle

查看更多
叼着烟拽天下
6楼-- · 2019-01-26 03:30

On the line 68 you have illegial symbols right after a closing bracket }.

enter image description here

Remove it and the code should work.

查看更多
登录 后发表回答