Skip to content

mahdix18/hashtags.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

hashtags.js

Make hashtags on your site like facebook and twitter

How To Use It

Simple String Replace Example: Let's replace hashtag keywords with url : In this example we replace @@@ in <a href='http://www.site.com/hashtag.php?hashtag=@@@'>@@@</a> with the keyword then replace keyword with this link .

x = ("I love #javascript and #php").parseHashtag("<a href='http://www.site.com/hashtag.php?hashtag=@@@'>@@@</a>","@@@");

Callback function Example: Let's Count Hashtag keywords :

var count=0;
"#hello #word #i'm #very #happy".parseHashtag(function(tag){
    count++
  });
 console.log(count);

Let's replace keywords with url :

"#hello #word #i'm #very #happy".parseHashtag(function(tag){
      return 'http://www.site.com/hashtag.php?hashtag='+tag;
  });

Author

Mahdi Jouini

About

Make hashtags on your site like facebook and twitter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published