-
Notifications
You must be signed in to change notification settings - Fork 32
/
demo.html
37 lines (36 loc) · 1.03 KB
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<html>
<head>
<title>Linkify jQuery Plugin</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js" type="text/javascript"></script>
<script src="jquery.linkify.js" type="text/javascript"></script>
<style type="text/css">
textarea {
width: 300px;
height: 50px;
}
</style>
<script type="text/javascript">
function toHashtagUrl(hashtag) {
return "http://myservice.com/search?q=" + hashtag;
}
$(document).ready(function() {
$("form input[type='submit']").click(function() {
str = this.form.content.value
$("#content").html(str);
$("#content").linkify({hashtagUrlBuilder: toHashtagUrl, noFollow: false});
return false;
});
});
</script>
</head>
<body>
<h1>Linkify jQuery Plugin Demo</h1>
<form>
<textarea name="content">Go to http://www.youtube.com or www.vimeo.com to watch the #movie</textarea>
<div>
<input type="submit" value="Apply"/>
</div>
</form>
<div id="content"></div>
</body>
</html>