0
<g:javascript>
 function yes(data){
 var id=$('#id').val(); 
 var pars = 'id=' + id+"&contact_preferences.email="+data;
 $.ajax({
        url: "${createLink(controller: 'userform', action: 'update')}",
        type: 'GET',
        data: pars,           
        success: function(data) {               
              alert("yupee");                
        }
    });
 }
</g:javascript>

i really dont know how to pass a value in ajax using type "GET"

sagar mane
  • 123
  • 2
  • 13
  • Read the jQuery ajax documentation. – James Kleeh Jun 05 '13 at 10:50
  • i know @JamesKleeh .. but the thing is when i use type GET.. it gives an error.. but when i use Post type its working fine...and the main thing is in grails passing values in different type.. so that controller know – sagar mane Jun 05 '13 at 10:55

1 Answers1

1

See jQuery.ajax docs examples how to use data. In your case:

var pars = {id:id,contact_preferences.email:data};
Mr. Cat
  • 3,522
  • 2
  • 17
  • 26