I am new to Javascript. I am writing a Java code which internally write code to call predefined Javascript method.
I have a Javascript method defined as:
function myfunction(url, params) {
$.post(url, params);
}
This send params which is a JSON to the URL as post (I suppose).
My Java code generate HTML on the fly which internally generate something like:
<iframe onLoad="myfunction(myinternal, {"system":"abcdef", "token": "12345"})"> ......
However, this fails to run. Page inspection gave me:
SyntaxError: invalid property id
myfunction(myinternal, {
^
What did I do wrong here?
Many thanks
". Either wrap the attribute in'or use javascript to capture the onload event.