I have a showPreview option for an entered URL on my site just like Facebook shows a preview of the URL.
When the User enters the url, the following condition gets verified:
$('#text').keyup(function(e) {
allowPosting = true;
if ((e.which === 13 || e.which === 32 || e.which === 17) && trim($(this).val()) !== "")
}
Key code:
13 - Enter
45 - Insert
17 - control
Now the function is being called when the user copy and pastes the URL or Selects the URL from the preview and presses Enter key
What I want:
The preview should be shown if the user types in the URL, even if the user does not press the enter key or copy and pastes the URL.
What should I do?