I wonder if there was a good way to do this, thought that I would send a message to the SO community ...
There is a third-party web page in which I have no control over how it is displayed, but they allow me to add jQuery.
Using jQuery, I create a navigation menu on the side of the page, this will be a list of links. The onclick event of these links I get from existing onclick events already on the page, but when I do:
var linkLoc = $('#theLink').attr("onclick");
linkLoc returns:
function onclick(event) { handleJumpTo("com.webridge.entity.Entity[OID[E471CB74A9857542804C7AC56B1F41FB]]", "smartform"); }
instead of what i expect:
handleJumpTo("com.webridge.entity.Entity[OID[E471CB74A9857542804C7AC56B1F41FB]]", smartform");
I think JQuery is trying to get an event to bind, but I need the actual Javascript markup, as I am creating HTML dynamically. I guess I could fine-tune the onclick (event) {"out function, but it seems to be hacky.
Any ideas on an elegant way to get onclick markup?
javascript jquery
Mark kadlec
source share