Sending multiple data parameters with jQuery AJAX

前端 未结 7 615
一个人的身影
一个人的身影 2020-11-29 22:00

I am sending an ajax request to a php file as shown here:

function checkDB(code, userid)
{

  $.ajax({
  type: \"POST\",
  url: \"

        
相关标签:
7条回答
  • 2020-11-29 23:02

    Try this code... it is working for me ...

    <script type='text/javascript'>
    $(document).ready(function(){
      $(".star").click(function(){
       var rate_value1= $(this).index(".star")+1;
        $.ajax({
        type: "POST",
        dataType: "json",
        url:  "<?php echo(rootpath()) ?>/vote.php",
    
    data: { product_id: '<?php echo($product_id_to_permalink) ?>' , rate_value: rate_value1 }
    
            });
          });
        });
    </script>       
    
    0 讨论(0)
提交回复
热议问题