|
<head> |
|
<title>protectMail Examples</title> |
|
<script src="http://code.jquery.com/jquery-2.0.2.min.js"></script> |
|
<script src="protectMail.js"></script> |
|
</head> |
|
<body> |
|
|
|
<h1>protectMail Examples</h1> |
|
|
|
<p> |
|
<h2>1. Generate href-attribute and replace content</h2> |
|
<h3>Code:</h2> |
|
<code> |
|
<a id="selector1" data-name="joe" data-host="fbi" data-ending="com"></a> |
|
<br> |
|
<script> |
|
<br> |
|
$('#selector1').protectMail(); |
|
<br> |
|
</script> |
|
<br> |
|
<br> |
|
=> |
|
<br> |
|
<a id="selector" data-name="joe" data-host="fbi" data-ending="com" href="joe@fbi.com">joe@fbi.com</a> |
|
</code> |
|
<h3>Result:</h3> |
|
<a id="selector1" data-name="joe" data-host="fbi" data-ending="com"></a> |
|
<script> |
|
$('#selector1').protectMail(); |
|
</script> |
|
</p> |
|
|
|
<p> |
|
<h2>2. Works for multi-selectors too</h2> |
|
<h3>Code:</h2> |
|
<code> |
|
<a class="selector2" data-name="joe" data-host="fbi" data-ending="com"></a> |
|
<br> |
|
<a class="selector2" data-name="phil" data-host="cia" data-ending="com"></a> |
|
<br> |
|
$('.selector2').protectMail(); |
|
<br> |
|
<br> |
|
=> |
|
<br> |
|
<a class="selector2" data-name="joe" data-host="fbi" data-ending="com" href="joe@fbi.com">joe@fbi.com</a> |
|
<br> |
|
<a class="selector2" data-name="phil" data-host="cia" data-ending="com" href="phil@cia.com">phil@cia.com</a> |
|
</code> |
|
<h3>Result:</h3> |
|
<a class="selector2" data-name="joe" data-host="fbi" data-ending="com"></a> |
|
<a class="selector2" data-name="phil" data-host="cia" data-ending="com"></a> |
|
<script> |
|
$('.selector2').protectMail(); |
|
</script> |
|
</p> |
|
|
|
<p> |
|
<h2>3. Only generate href-attribute</h2> |
|
<h3>Code:</h2> |
|
<code> |
|
<a id="selector3" data-name="joe" data-host="fbi" data-ending="com">my custom content</a> |
|
<br> |
|
$('#selector3').protectMail({ content: false }); |
|
<br> |
|
<br> |
|
=> |
|
<br> |
|
<a id="selector3" data-name="joe" data-host="fbi" data-ending="com" href="joe@fbi.com">my custom content</a> |
|
</code> |
|
<h3>Result:</h3> |
|
<a id="selector3" data-name="joe" data-host="fbi" data-ending="com">my custom content</a> |
|
<script> |
|
$('#selector3').protectMail({ content: false }); |
|
</script> |
|
</p> |
|
|
|
<p> |
|
<h2>4. Only replace content</h2> |
|
<h3>Code:</h3> |
|
<code> |
|
<span id="selector4" data-name="joe" data-host="fbi" data-ending="com"></span> |
|
<br> |
|
$('#selector4').protectMail({ href: false }); |
|
<br> |
|
<br> |
|
=> |
|
<br> |
|
<span id="selector4" data-name="joe" data-host="fbi" data-ending="com">joe@fbi.com</span> |
|
</code> |
|
<h3>Result:</h3> |
|
<span id="selector4" data-name="joe" data-host="fbi" data-ending="com"></span> |
|
<script> |
|
$('#selector4').protectMail({ href: false }); |
|
</script> |
|
</p> |
|
|
|
</body> |