I am totally new to coding. Please help. I am obtaining tweet text using node.js and displaying using html. I want to create hyperlink for URL contained in it.
for ex: #Times #News Ukrainians, Awaiting International Action After Crash, Fear Complacency http://t.co/YjZ4YV8qMk
This is the text I obtain. These are without hyperlink.When i click on #Times or http://t.co/YjZ4YV8qMk it should open on new page. Here is my html with jquery.
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<form>
#<input type="text" id="tag" class="hash"/>
<button>submit</button>
</form>
<div id="tweets"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js"></script>
<script src="/socket.io/socket.io.js"> </script>
<script>
var socket = io.connect('/link');
$('.hash').change(function(){
$('#tweet').after();
socket.emit('message', $('#tag').val());
$('#tag').val('');
return;
});
socket.on('message', function(msg){
$('#tweets').after($('<div>').text(msg));
});
</script>
</body>
<html>
Mistake 1: you include two jquery library files
Mistake 2: Jquery library order be wrong it is always be on top of other scripts
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js"></script>
<script src="/socket.io/socket.io.js"> </script>