Does anybody have any idea why this doesn’t work?
$(document).ready(function() {
var loading;
var results;
form = document.getElementById('form');
loading = document.getElementById('loading');
results = document.getElementById('results');
$('#Submit').click( function() {
if($('#Search').val() == "Desired name here..")
{alert('Please enter a valid domain name, Thank you.');return false;}
results.style.display = 'none';
$('#results').html('');
$("#loading").fadeIn(2000);
$.post('process.php?domain=' + escape($('#Search').val()),{
}, function(response){
results.style.display = 'block';
$('#results').html(unescape(response));
loading.style.display = 'none';
});
return false;
});
});
HTML:
<a href="#" id="Submit"><img src="img/submit_domain.png" height="30" width="73" class="host_sb"></a>
I have jQuery installed, and it works in every other browser.
This is my problem:
Nothing loads. The #loading doesn’t show which in turn doesn’t display the #results
Your code is weird mix of plain JavaScript and jQuery.. not sure this cause the problem but try this optimized version:
If no luck, try debug if you don’t have any tools use plain old alert – add
alert('got here');in key lines like the beginning of the.click()function or the AJAX callback.