All Things Techie With Huge, Unstructured, Intuitive Leaps

Uncaught ReferenceError: $ is not defined?

Okay, so I had a onload javascript function with a paramter called in a jsp.  I got the parameter from a URL.


String thisParam = request.getParameter("myParam");


Immediately after this line, I called a onload function passing the above parameter:

<body onload="call(<%=thisParam%>)">

I kept getting the value of thisParam is not defined.  Uncaught Reference Error.

So what cured it?

I was missing the single quotes:

<body onload="call('<%=thisParam%>')">

Hope this helps someone.

No comments:

Post a Comment