How to pass Ajax object as parameter on model

81 Views Asked by At

I have the following Ajax method, How to I passed the Parameter on Scala model file, Already I googled it but no Use

$('#application').on('change', function(){
    var x = document.getElementById("application");
    var status = x.options[x.selectedIndex].value;
    var y = document.getElementById("clg");
    var clg = y.options[y.selectedIndex].value;
    $.ajax({
        url:"/getApp?application="+status+"&clg="+clg,
        success:function(result){
            $.map(result,function(obj, i){
                **var numbers = obj.values**
                $('#table_for_list').append('@if(models.sample.app.getAll**('+ numbers +')** == 0) { ---- } else { --- }')
                    (OR)
                $('#table_for_list').append('@if(models.sample.app.getAll**(\''+ numbers +'\')** == 0){ ---- } else { --- }')
            });
        }
    });
});

can someone give me a few points to correct the syntax on passing the parameter?

0

There are 0 best solutions below