Russell Gutierrez
Russell Gutierrez

Reputation: 1385

Javascript function does not exist during runtime

I have a Javascript function in a separate jsp file: (used <jsp:include> for file inclusion)

function tickMembership(code){}

when invoked using onclick in an html element, the following error occurs:

Uncaught ReferenceError: tickMembership is not defined

Any idea on how this might happen? The script is there even when inspecting the sources in the browser. I am using Google Chrome.

Upvotes: 0

Views: 234

Answers (2)

cwishva
cwishva

Reputation: 1978

It is a caching issue the browser is caching the .JS file clear the browser cache and try

Happy Coding.

Upvotes: 0

Apurv
Apurv

Reputation: 309

Attach the eventListener on load of the dom.

or if you are inserting the html dynamically you can use jquery 'on' method.

Upvotes: 1

Related Questions