replace text to variable's value using jquery
replace text to variable's value using jquery I have created a function to get sms message from db using ajax get call and after success i want to replace the {order_id} text to order-id like 454574 and may b few more variables like customer name etc. sms message ajax get call {order_id} 454574 MY TRY $(document).delegate('.sms-template', 'click', function() { var tempID = $(this).attr('id').replace('sms-template-',''); var oID = $(this).attr('data-id').replace('sms-template-',''); $.ajax({ url: 'index.php?route=sale/order/getSmsTemplate&token=<?php echo $token; ?>&template_id='+tempID, type: 'get', dataType: 'json', success: function(json) { $('textarea#input-order-comment-'+oID).append(json['message']); }, error: function(xhr, ajaxOptions, thrownError) { alert(thrownError + "rn" + xhr.statusText ...