$(document).ready(function(){ var link = $("input[name=linkGetPromotionTools]").val(); $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') } }); $.ajax({ url: link, type: 'post', data: { linkCurrent: window.location.href , windowWidth: screen.width, windowHeight: screen.height }, success: function(result){ if(result != 0){ $('body').append(result); } } }); });