在laravel中使用ajax调用并获取document.execCommand(“ copy”),但无法正常工作

时间:2019-09-19 08:30:10

标签: ajax laravel

$.ajax({
    type:'GET',
    url:apprul,
    success:function(request){
        var copy = $('.class');
        Clipboard(copy);
     },
     error: function (request, error)
     {
        alert('Your Login session is expiry please log in and try again');
        window.location.href = apprul;
      }
});

1 个答案:

答案 0 :(得分:0)

$.ajax({
   type:'GET',
   url:apprul,
   async: false, 
   success:function(request){
     var copy = $('.class');
     Clipboard(copy);
   },
   error: function (request, error)
   {
     alert('Your Login session is expiry please log in and try again');
     window.location.href = apprul;
    }
  });