in the getURL() function missing a semi-colon at the end, I can't see any syntactic error in what you've done. I'm not familiar with require so cannot advise there as to when you can call jQuery document loaded functions.
You can just go back to basics, and add an "onClick" event handler to your "Press Enter" button, like this:
And then add a script block afterwards which does exactly the same thing as your jQuery based code, so create a function e.g. validateLogin() which does exactly the same thing - reads the text input field and concatenates it with your URL, checking for "blankness":
Code:
function validateLogin(){
var prefix = "http://";
var suffix = "-remoteally.viewnetcam.com:40040";
var username = document.getElementById("username");
var myURL = prefix + username.value + suffix;
if (username.value.replace(/ /g,'')!=='') {
window.location.href = myURL;
}
else {
username.parentElement.setAttribute("class","error");
}
}
in the getURL() function missing a semi-colon at the end, I can't see any syntactic error in what you've done. I'm not familiar with require so cannot advise there as to when you can call jQuery document loaded functions.
You can just go back to basics, and add an "onClick" event handler to your "Press Enter" button, like this:
And then add a script block afterwards which does exactly the same thing as your jQuery based code, so create a function e.g. validateLogin() which does exactly the same thing - reads the text input field and concatenates it with your URL, checking for "blankness":
Code:
function validateLogin(){
var prefix = "http://";
var suffix = "-remoteally.viewnetcam.com:40040";
var username = document.getElementById("username");
var myURL = prefix + username.value + suffix;
if (username.value.replace(/ /g,'')!=='') {
window.location.href = myURL;
}
else {
username.parentElement.setAttribute("class","error");
}
}
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.