English 中文(简体)
将微粒转嫁给AJAX
原标题:Rating plugin pass value to AJAX
最佳回答

看起来好像是解决问题,把这个问题放在今后帮助的位置上。

          <head>
   <title></title>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <script type="text/javascript" src="js/jquery.min.js"></script>
   <script type="text/javascript" src="js/jquery.raty.min.js"></script>

        </head>
       <?php

     $id=1;
          $msg_id=192;
               ?>
          <body>
              <div class="rate" id="rate" >
            <div id="click" name="click<?php echo $msg_id ;?>" >
   <input type="text" id="valrate" name="valrate" value="fff"/>
    </div>
    <input type="hidden" id="uniqueRateID" name="uniqueRateID" value="<?php                         echo $id; ?>" />
    <input type="hidden" id="type_id" name="type_id" value="<?php echo $msg_id ;?>" />
    </div>
       <script type="text/javascript">
              $( #click ).raty({

                 });


         $("#rate").click(function()
          {
          var a = $( #uniqueRateID ).val();
       var b = $( #type_id ).val();
         var c = $( #valrate ).val();


       $.ajax({
         type: "POST",
         url: "greet.php",
         data: "dataString=" + dataString,
         success: function(result){
             $("#response").html(result);
          }
       });   
});

问题回答

你们正在使用纯java字母来提出ja子的要求。 你们必须把所寄发的数值编码成正文,即编码Uricomponent(a)。

但是,由于你将 j笑包括在内,我会建议你将ja子的要求简单地用 j子方法提出,因此你不需要XHR探测功能:

$.get( modules/manage friends/update_friend.php ,{ab:a,bc:b,cd:c},function(accdata){

alert(accdata);

document.getElementById( request ).value="Request Sent";
 document.getElementById( request ).disabled=true;

});




相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...

热门标签