0

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);

            });
}
2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by fobos
0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.