I am trying to archive a database entry using .post, but I am getting this error: "Uncaught SyntaxError: Unexpected token ("

I am defintely still in the learning phase of jQuery, so any help is appreciated!

//Archive Table Row
function archiveEntry(id){
   function(){
      if (confirm("Archive Fill #"+id+"?")) {
         $.post('/elevator/scripts/php-inc/archive.php', {id: +id, ajax: 'true' },
         function(){
            $(".row_"+id).fadeOut();
         });
      }
      else {
         return false;
      }
   }
}

Recommended Answers

All 3 Replies

function(){

should be 'function($){'

You have a function within a function, which is perfectly valid in javascript, but the inner function is neither called nor necessary.

Purge the inner function wrapper leaving the operative code in the outer function.

The third, innermost (callback) function is fine. Leave it as it is (and debug if necessary).

Airshow

Thanks, that did it! Feel like such a noob...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.