﻿/**
 * use prototype method to get url
 * id is not null
 **/
function getURLUsePrototype(url, id){
  if(null==id)
    return;
  var index = url.indexOf('?');
  var uri;
  var pars;
  if(index >- 1){
    uri = url.substring(0, index);
    pars = url.substring(index + 1);
  }
  else{
    uri = url;
    pars = '';
  }
  var myAjax = new Ajax.Updater(
  {success: id},
  uri,
  {
  method: 'get',
  parameters: pars,
  evalScripts: true,
  onFailure: reportError
  });
}
       
function reportError(request){
  alert('访问错误,请稍后再试!');
}
