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 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/
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.