Current time: 10-18-2017, 06:29 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting problems: click, sendClick
03-04-2013, 08:03 PM
Post: #1
Scripting problems: click, sendClick
Hi, Meenan,

Thanks for your great WPT. It works very well for me except some scripting problems.

I have a span button on the page looks like:
<span id="btn" clicked="true" >click me</span>
Behind this button, there are some JavaScript code which listens to the click event(Say btn_click()). While this button is hit, btn_click() would send an ajax post request. The question here is: I have tried both "click id=btn" and "sendClick id=btn", neither of these functions trigger btn_click().
I guess it is because what click and sendClick functions have done, is to inject an javascript code into webpage and then use the injected javascript to trigger the DOM event. Due to the security concern, the injected javascript would not be able to call native functions like btn_click() in this case. Am I right?
If I am right, is there any API could simulate a system level mouse click or directly call the native javascript methods(By saying native, I mean the javascript within the webpage)?

Thanks again for your help and time!
Find all posts by this user
Quote this message in a reply
03-09-2013, 01:22 AM
Post: #2
RE: Scripting problems: click, sendClick
I don't think it's a security issue. In Chrome or Firefox the injected javascript has full permission to do whatever it wants since it is from an extension. In IE it uses the c++ DOM bindings. Have you tried just using the exec or execAndWait commands to call btn_click() directly?
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)