Linkify is a jQuery plugin for finding URLs in plain-text and converting them to HTML links. It works with all valid URLs and email addresses.
1. INCLUDE JS FILES
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="js/jquery.linkify.min.js"></script>
2. HTML
<p id="paragraph1">Check out this link to http://google.com</p>
<p id="paragraph2">You can also email support@example.com to view more.</p>
3. JAVASCRIPT
$(window).on('load', function ()
$('p').linkify();
);
4. OPTIONS
Linkify is applied with the following default options. Below is a description of each.
$('selector').linkify(
tagName: 'a',
target: '_blank',
newLine: '\n',
linkClass: null,
linkAttributes: null
);
Linkify - Intelligent URL recognition
No comments:
Post a Comment