I am making application where i need to insert value which are double clicked.can any one suggest me how to insert a word in database after double click in any word in a paragraph.
Like
http://www.thefreedictionary.com
In this Website after double click it search the meaning of that word, but i have to insert double clicked value in database.Please help me if any body have idea.
thanks in advance
-
use jQuery ajax api.jquery.com/jQuery.ajaxsravis– sravis2013-12-11 06:07:02 +00:00Commented Dec 11, 2013 at 6:07
-
Refer to this link stackoverflow.com/questions/12321511/…user2936213– user29362132013-12-11 06:09:47 +00:00Commented Dec 11, 2013 at 6:09
Add a comment
|
2 Answers
use AJAX preferably with jQuery. The process should work like this: dbclick->take data->initiate ajax request with POST to a PHP page->execute
Some sample code :
$('element').dblclick(function(){
var data = //your handler here
$.ajax({
//code here
});
});
Take a look at this: http://api.jquery.com/jQuery.ajax/
1 Comment
MayTheSchwartzBeWithYou
Check this also. Although I would recommend you search if it can be done with jquery. It will minimize your code size stackoverflow.com/questions/275761/…
On page load, initiate one function which listen for double click. You can get jquery for it easily.
On click post selected text i.e. word through post(preferable) or get method to page which performs database insertion.
1 Comment
user123
@NirdoshShrestha: Welcome for next. you should up vote the answer if it helped you anyhow