I have the following code.
The getJson works if it's not placed within the keyup function, but within it, it throws error of 'illegal invocation'. Basically, I have a form in which users can select a custom URL (ie like facebook.com/techboyjk), and as they type in it, I want query if that entry is taken or not. But I'm not sure what's causing the error. Anybody see any issues? I'm kind of at a loss.
works -- >
breaks -->
The getJson works if it's not placed within the keyup function, but within it, it throws error of 'illegal invocation'. Basically, I have a form in which users can select a custom URL (ie like facebook.com/techboyjk), and as they type in it, I want query if that entry is taken or not. But I'm not sure what's causing the error. Anybody see any issues? I'm kind of at a loss.
works -- >
Code:
$.getJSON(
'http://mysite.at/config/cfc/dns.cfc',
{
method : 'dnsQuickCheck',
url : url
},
function(result){
if (result.error == 1) {
$('#urlExistsError').show();
}
}
);
breaks -->
Code:
$('#url').keyup(function(){
var checkURL=$(this).val();
if(checkURL!=''){
$.getJSON(
'http://mysite.at/config/cfc/dns.cfc',
{
method : 'dnsQuickCheck',
url : url
},
function(result){
if (result.error == 1) {
$('#urlExistsError').show();
}
}
);
}
});
Last edited: