Wikipedia is ocean of information. And in today's post, you will find how can you get the description of any string/text from Wikipedia and display them in tooltip using jQuery Plugin. wikiUp is a jQuery plugin which allows you to display Wikipedia descriptions in tooltips.
To use wikiUp plugin, you need to include jQuery.js, wikiUp.js and wikiUp.css. Once that is included then wrap the text/string on which Wikipedia description needs to shown in <data> tag.
Now, there are 2 important attributes which you need to set.
1. data-wiki: This attribute is compulsory. And one need to set title of the Wikipedia page as value to this attribute.
2. data-lang (This is optional).If you want to get data in a different language, use data-lang. Default is English.
So sample HTML code is like,
How to use it?
To use wikiUp plugin, you need to include jQuery.js, wikiUp.js and wikiUp.css. Once that is included then wrap the text/string on which Wikipedia description needs to shown in <data> tag.
Now, there are 2 important attributes which you need to set.
1. data-wiki: This attribute is compulsory. And one need to set title of the Wikipedia page as value to this attribute.
2. data-lang (This is optional).If you want to get data in a different language, use data-lang. Default is English.
So sample HTML code is like,
<data data-wiki="jQuery">jQuery</data> was founded by <data data-wiki="John Resig">John Resig</data>.And there is no jQuery code. The plugin will handle automatically.
Official Website
Feel free to contact me for any help related to jQuery, I will gladly help you.
No comments:
Post a Comment