I am working on a feature where if you click a blurb link, it will display the full description in a preview window; much like the search result preview in search engines, like Google.
I need to pass both the full description text and the event to the handling function so the function knows what to display and where to display (under the blurb).
My question is that what should I pass to the function. Currently I have below and it’s not working:
<a href="javascript:DisplayFullDescription('blah blah description goes here');">blurb text here</a>
function javascript:DisplayFullDescription(e, fullText){
//find out mouse click position
//display a preview window (div) with description there
}
It would be much easier to use jQuery to bind the event handlers, and an HTML5
data-*attribute to store the full text, rather than usingonclickattributes.HTML:
jQuery/JavaScript: