This time I will share jQuery Plugin and tutorial about Tiny jQuery Plugin To Parse URLs Within Text – Linkalize, hope it will help you in programming stack.
Linkalize is a super tiny jQuery plugin which parses all URLs within your text and converts them into appropriate links for better user experiences.
How to use it:
1. Include the jQuery Linkalize plugin after jQuery library before the closing body tag.
1 |
< script src = "//code.jquery.com/jquery-1.11.3.min.js" ></ script > |
2 |
< script src = "jquery-linkalize.js" ></ script > |
2. Call the plugin and we’re done. In this case, all the plain text references of URLs inside the container ‘demo’ will be converted into clickable links.
1 |
$( '#demo' ).linkalize(); |
3. You can add additional CSS classes to links using ‘class’ attribute on init.
4. By default, the links will be opened in the same window. You can change the ‘open’ options to open the links in a new window.
5. The plugin also allows adding additional Html5 data attributes to links using ‘data’ object.
This awesome jQuery plugin is developed by brunoskonrad. For more Advanced Usages, please check the demo page or visit the official website.