javascript,jquery,onclick,autolink
The simplest way: $( "span" ).click(function() { var link = 'http://yousite.com/tag/'+ $(this).text().replace(/ /, "-")+"/"; window.location.href= link.toLowerCase(); }); DEMO http://codepen.io/tuga/pen/yNyYPM...
Since you've gotten the correct $_POST variables according to your comment, you need to fix this now $nesne=str_replace($keywords,'<a href="$link" title="$keywords" target="new">$keywords</a>',$text2 ,1); You cannot put variables in a single-quote delimited string - use double quotes around it with single-quotes inside. Like this: $nesne=str_replace($keywords,"<a href='$link' title='$keywords' target='new'>$keywords</a>",$text2 ,1); ...
javascript,jquery,regex,autolink
Thats because document.getElementById( 'testing' ) is returning null.. and you are trying to get innerHTML of null object.. It is returning null because your script is loaded before <div id="testing">. Move the script below it and it will work.. ...
Please check the below code. I had tried using below code. TextView tv = .... tv.setMovementMethod(LinkMovementMethod.getInstance()); String content = tv.getText().toString(); List<String> links = new ArrayList<String>(); Pattern p = Patterns.WEB_URL; Matcher m = p.matcher(content); while (m.find()) { String urlStr = m.group(); links.add(urlStr); } SpannableString f = new SpannableString(content); for (int i...