How to pass Object as a parameter in Javascript

schneider159

New Member
I want to pass Object in function. Here is my code\[code\]var hyperLinkObj = new Object();hyperLinkObj.path="abc";hyperLinkObj.text="abctext";'<li><a href="http://stackoverflow.com/questions/15903829/#" onclick="onItemClick(hyperLinkObj)">'+description+'</a></li>'\[/code\]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 \[code\]'<li><a href="http://stackoverflow.com/questions/15903829/#" onclick="onItemClick([object Object])">'+description+'</a></li>'\[/code\]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 hyperLinkObj3] 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 ?
 
Top