Prototype Framework

Here are a few functions I've used on my image gallery that use the prototype framework (free).

var random_variable = "rv=" + parseInt(Math.random()*99999999999);

function open_directory(some_id,dir,page,page_start,page_end){
  new Ajax.Request('open_dir.php?dir=' + dir + '&' + random_variable,
    {
      method:'post',
      onSuccess: function(transport){
        var response = transport.responseText || "no response text";
        document.getElementById(some_id).innerHTML = response;
      },
      onFailure: function(){
        alert('Something went wrong...');
      }
    }
  );
}

function open_directory2(some_id,dir,page,page_start,page_end){
  new Ajax.Updater(some_id,'open_dir.php?dir=' + dir + '&' + random_variable,
    {
      method:'post',
    }
  );
}

// rightcolumnbody

function show_image(some_id,file,page,page_start,page_end){
  new Ajax.Updater(some_id,'show_image.php?file=' + file + '&' + random_variable,
    {
      method:'post',
    }
  );
}

Page Comments (Click to edit)






[Click to add or edit comments])

Please prepend comments below including a date

Design by N.Design Studio, adapted by solidGone.org (version 1.0.0)
Have a nice day.