Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript working in jsfiddle but not in the browser. Reply To: working in jsfiddle but not in the browser.

#187146
__
Participant

my code is working in jsfiddle but not in the browser.

How are you viewing the jsfiddle website, if not with a browser?

; )

But seriously: how does your markup+code differ from that which you put in jsfiddle? Is jsfiddle loading any assets for you (e.g., jQuery)? is jsfiddle running your code on DOM ready, and did you make sure to do the same?

Also, I know the formatting is bad here on the forums, but it looks like the code you posted is missing an opening bracket (right after else), and a semicolon (right after return true).