I want to pass Object in function. Here is my code
var hyperLinkObj = new Object();
hyperLinkObj.path="abc";
hyperLinkObj.text="abctext";
'<li><a href="#" onclick="onItemClick(hyperLinkObj)">'+description+'</a></li>'
Here I am creating Object called as "hyperLinkObj" Now I am creating "li" tag and putting hyperlink in li Now When I inspect the I am getting something like
'<li><a href="#" onclick="onItemClick([object Object])">'+description+'</a></li>'
So How can I pass the hyperLinkObject , as in the onItemClick I have do many thing on this Object.
See Actually I wanted to do something like this.
1] There is an Object which has many Category So wanted to loop through it. 2] then on Each category item click wanted to call OnItemClcik with hyperLinkObj 3] Then on click of on Hyperlink , wanted to do operation like fetching Hyperlink.path and show the Breadcrumb. 4] and finally I am using Extjs So Ext.Panel.update("Li text");
May be I didnt mentioned that ExtJs.update.. it is not working as per your suggestion..
Can you explain How can I achive this ?
var hyperLinkObj = { path: "abc", text: "abctext" };Preferred syntax for objects.