Convivea

Bit Che => Scripts & Development => Topic started by: chip! on August 25, 2007, 09:34:02 am

Title: SuprNova.org
Post by: chip! on August 25, 2007, 09:34:02 am
bovski,

i went through the java and found that it does use ajax to replace the 'submit' code of the search:

http://static.suprnova.org/suprnova.js

Code: [Select]
'form#search-q': function() {
        this.observe('submit', function(){
search(this.q.value, this.cat.value);
return false;
        })

which takes you to search( function:

Code: [Select]
function search(query, cat) {
if(query == "") {
form = $('search-q');
query = form.urlq.value;
page = form.urlp.value;
cat = form.urlc.value;
params = 'page=' + page + '&q=' + query + '&c=' + cat;
} else {
params = 'page=1&q=' + query + '&cat=' + cat;
}

var hideme = $('results').next();
if(query.length > 0) {
hideme.hide();
$('results').innerHTML = '<div id="loading"></div>';
$('results').show();
new Ajax.Updater('results', '/ajax_search.php', { method: 'post', parameters: params });
} else { $('results').hide(); hideme.show(); }
return false;
}



and from that, here is the proper search URL:
POSThttp://www.suprnova.org/ajax_search.php?page=1&q=%SEARCH%&cat=0
Title: Re: SuprNova.org
Post by: Bovski on August 26, 2007, 10:56:00 am
Thanks Chip

http://www.convivea.com/forums/index.php?topic=179.msg7227#msg7227