I started a simple node.js server locally. It gives out an index.html. I want a link on the index.html to localhost:4000 to open the same page in a new window. But the Browser cannot read the protocoll in the new window, only if I hit refresh. How can I make a link with the adress "localhost:4000" ?
SERVER:
//make url
socket.emit('url', 'click here');
index.html:
socket.on('url', function (data) {
$('#conversation').append('<a target="_blank" href="localhost:4000/">'+data +'</a>');
});
Try specifying the protocol (http):
$('#conversation').append('<a target="_blank" href="http://localhost:4000/">'+data +'</a>');
Have you tried to change it to http://localhost:4000/? This will make sure that it uses the correct application protocol.