PDA

View Full Version : click on a <p>



emilioF
5 Jul 2010, 7:55 AM
hi i want capture the click on a <p> this is my script http://paste.ubuntu.com/459506/ and the snippet sent from server is <p id='doc1' title='nome lungo documento'>doc1</p>. i have searched in forum and google and i I found that the solution is Ext.get("doc1").on("click", alert("ok"));. but it's doesn't work :( Can you help me?

Animal
5 Jul 2010, 7:59 AM
You set the click handler to be whetever the call to alert("ok") returns

Is that a FUNCTION?

emilioF
5 Jul 2010, 10:07 AM
the alert it's only a test then i make a ajax request but now for test i want that when i click on the <p> appear the alert. can you edit my script or write a snippet?

Animal
5 Jul 2010, 11:40 AM
Specify A FUNCTION as that parameter.

Read and understand the code that YOU write.

PASS A FUNCTION AS THAT PARAMETER.