Hi ,anybody plz help me.

i created own musttry button(same as like button).what is the problem.

this javascript function does not working.

planbook is class name.

function musttry_add(planbook_id)
{
     $.ajax({
            url: $('planbook').val(),
            type: 'POST',
            data: { personalId:personalId,  planbookId:planbookId },
            success: function(data, textStatus, jqXHR){
                musttry_get(planbook_id);
            }

            });
}



function musttry_get(planbook_id) {


     $.ajax({
            url: $('planbook').val(),
            type: 'POST',

            data: { personal_id:planbook_id },      
          $('planbook' + planbook_id + 'likes').text(Data);

            });
}

Try replacing

url: $(planbook).val()

with

$(".planbook").html()

Reason is, because if planbook is a css, then you need to add it with the "." in front of it. Val() is used on form elements, so in this case, if its not a form element, we use .html(). Read this link from jquery on $.ajax. jQuery Ajax

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.