javascript - How to access success data out of success block in jquery -
jquery.validator.addmethod("uniquerheading", function(value, element) { var info = false; $action_name = 'checkunquieannoucementheading'; var url = '<?php echo "$module_name/$controller_name/checkunquieannoucementheading"; ?>'; $.ajax({ url: url, type: 'get', data: { "txt_heading":value }, success: function(data) { // display list on page replacing content on existing, controller-action homecoming data; } }); }, "annoucement heading used");
working code...just utilize async: false
jquery.validator.addmethod("uniquerheading", function(value, element) { $action_name = 'checkunquieannoucementheading'; var response = false; var url = '<?php echo "$module_name/$controller_name/checkunquieannoucementheading"; ?>'; $.ajax({ url: url, type: 'get', data: { "txt_heading":value }, success: function(data) { // display list on page replacing content on existing, controller-action response = data; }, async: false }) homecoming response; }, "annoucement heading used");
javascript jquery ajax
No comments:
Post a Comment