<\/script>')

An object in the onclick inline event

Why is this not working?

<img id="xx" src="/Content/components/imgs/add.gif" onclick='ShowLookup({"id": "22","name": "Robert Pitt"})' />

or

<img id="xx" src="/Content/components/imgs/add.gif" onclick='ShowLookup("id": "22","name": "Robert Pitt")' />

When I click on the image, I get the error message: Invalid property id

+3
source share
1 answer

Works like a charm for me:

http://jsfiddle.net/neebz/uwywG/1/

+3
source

All Articles