Google Chrome + Jquery = Can't trigger function

1,011 views
Skip to first unread message

Daniel Faria

unread,
Mar 13, 2012, 4:16:13 PM3/13/12
to google-chrome-...@googlegroups.com

Ok,

So I have been using firebug and also some extensions I wrote to create shortcuts on website I use often. There's on thing that I don't understand why it doesn't work or why it's not possible:

Example code:

<input type="button" onclick="addNewRow()" id="addRow"/>
//This will add a new row to the current table.
//The function is defined by the website (not my function)

When using firebug:

jQuery("#addRow").click();
//This will simulate the button click, and will automatically add the new row.

When using google chrome extension:

jQuery("#addRow").click();
//It doesn't add the new row.

Why can't the extension execute the function once the button click occurs, and why firebug has no issues in running it?

Is this normal? Is this a security feature? or am I doing something wrong?

I know that I can't access existing functions in a website for security reasons, but why won't the button simulation trigger it for me?

PhistucK

unread,
Mar 30, 2012, 12:08:12 PM3/30/12
to Daniel Faria, google-chrome-...@googlegroups.com
Looks weird. However, chromium-extensions is the appropriate group for this discussion (or StackOverflow).

PhistucK
Reply all
Reply to author
Forward
0 new messages