Empty cart functionality with a link, (no form) in Ubercart
Check Cart Links API page:
http://www.ubercart.org/node/1427

So, you have to enable Cart links module (included in Ubercart) and your link will be:

http://example.com/cart/add/e


Ubercart wil ask for confirmation for this action. If you don't want this confirmation I think you will have to write your own empty cart routine:

Define in your own module hook_menu an entry for your desired path. Then, assign as callback a function of your own. Inside that function, call uc_cart_empty(uc_cart_get_id());

For example:

  function mymodule_menu() {
    $items['your/path'] = array(
      'page callback' =&gt; 'mymodule_empty_cart',
    );
    return $items;
  }

  function mymodule_empty_cart() {
    uc_cart_empty(uc_cart_get_id());
    return 'Your cart has been emptied.';   
  }


Note that have to provide a message to show the user.

If you want to use the link with AJAX (so no page reload is done) you will need to something like this:

 function mymodule_menu() {
    $items['your/path'] = array(
      'page callback' =&gt; 'mymodule_empty_cart',
      'type'          =&gt; MENU_CALLBACK
    );
    return $items;
  }

  function mymodule_empty_cart() {
    uc_cart_empty(uc_cart_get_id());
    print 'done';   
  }


You will have to add the jQuery code to do the AJAX call. The print statement is sent back to user's browser but it will not be shown (at least if you do not show it to the user in your jQuery code).

For both examples you may adjust the other menu options (access restrictions, for example). Check hook_module documentation:
http://api.drupal.org/api/drupal/modules--system--system.api.php/function/hook_menu/8