Changing type of jQuery post

$(".eventer button[name=lol]").click(function() { 
console.log('clicked'); 
thisBtn = $(this); 
parent = $(this).parent(); 
num = parent.data('num'); 
id = parent.data('id'); 

if(typeof num != 'number'){ 
    num = 0; 
} 
$(this).attr('disabled', true); 

$.ajax({ 
    url: 'javas.php', 
    data: "num="+ ( num + 1 ) +"&id="+id, 
    success: function(data) {
        console.log('Ajax success'); 
        parent.data('num', ++num); 
        parent.next('.status').html(num); 
        thisBtn.attr('disabled', false); // reset 
    } 
}); 

console.log('-- end'); 
 }); 

How would i change this function to a $.post function, keeping all the button attributes etc. I need the value of num to be sent to javas.php and then that data to be echoed in the status class.

Answers


would this work:

 $.post('javas.php', {num: (num+1), id: id}, function(data) { ... });

see:

http://api.jquery.com/jQuery.post/


Need Your Help

How to get ctags to pick up functions in a .h file?

osx ctags

I am using Exuberant Ctags 5.7. I am trying to build a tag database for CGContext.h with:

How to convert Asp.net Web Project to Website…?

asp.net

i have code in asp.net web Project ... i want to convert that code to asp.net web site .. can any one help me for convertion of my code....

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.