On Sat, Jul 2, 2011 at 1:07 AM, taqman filler <[email protected]> wrote:

> I need to send data from ajax to controller
> some body help me to modified code
> this ajax code
> ajax.js
> function loadtooltip(obj, $user_id) {
>      //AJAX
>      var req = Inint_AJAX();
>      req.onreadystatechange = function () {
>           if (req.readyState==4) {
>                if (req.status==200) {
>                     displaytooltip(obj, req.responseText);
>                }
>           }
>      };
>      //���ҧ connection
>      req.open("POST", "
> http://127.0.0.1/cakeplate/tooltips/tooltip/$user_id";, true);
>      req.setRequestHeader("Content-Type",
> "application/x-www-form-urlencoded");
>      req.send($user_id); //�觤��
> };
>
>
try $.ajax in jqyery

$.ajax{(
           type: "POST",
         url: 
"http://127.0.0.1/cakeplate/tooltips/tooltip/<http://127.0.0.1/cakeplate/tooltips/tooltip/$user_id>"+user_id,
// get user_id and pass it here
         success: function(msg){
           $('.class').html(' '+msg);  // this is will get result
         }
});

Link : http://api.jquery.com/jQuery.ajax/


Regards

sathia
http://www.sathia27.wordpress.com

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to