Quiver
Active member
I am trying to use this:
It's the JavaScript part of the script which works over AJAX.
The script works but instead of loading what I want it loads a blank white page with my PublicityClerks ad in the top left corner of the screen. It appears to be conflicting with something. My guess is, AJAX on pages just doesn't work. Am I right or wrong? How can I get it to work?
We're talking something like this: http://pagerank.deaduseful.com/
Code:
<script type='text/javascript'>
//<![CDATA[
function clearInput(e) {
if (e.cleared) { return; }
e.cleared = true;
e.value = '';
e.style.color = '#000';
}
$(window).load(function(){
var runningRequest = false;
var request;
function fetch (q) {
if(q.length < 2){
$('div#pagerank').html('');
return false;
}
$('div#pagerank').html('loading...');
//Aborting running requests improves performance
if(runningRequest){
request.abort();
}
runningRequest=true;
request = $.post('',{
q:q
},function(data){
if (data) {
style = 'width:'+data*10+'%';
} else {
data='N/A';
style = 'background: #ccc';
}
$('div#pagerank').html('<div style="'+style+'">'+data+'</div>');
runningRequest=false;
});
};
/*if ($('input#q').val() <1) {
//prompt user to type
} else {
fetch($('input#q').val());
}*/
$('input#q').keyup(function(e){
e.preventDefault();
fetch($(this).val());
});
$('form').submit(function(e){
e.preventDefault();
});
});
//]]>
</script>
The script works but instead of loading what I want it loads a blank white page with my PublicityClerks ad in the top left corner of the screen. It appears to be conflicting with something. My guess is, AJAX on pages just doesn't work. Am I right or wrong? How can I get it to work?
We're talking something like this: http://pagerank.deaduseful.com/