2017-02-01 46 views
0

我試過了我發現的所有建議,並且無法使此按鈕在iPhone或iPad上正常工作。它幾個月前曾經工作過,現在不行。對個人電腦來說很好。嘗試過touchstart,並且光標:指針;已經在CSS中沒有運氣。任何其他想法?放輕鬆...我其實不是程序員。jquery按鈕突然不能在iPhone或iPad上工作

HTML是:

echo '<td><span style="color:#fff;" thing1="'.$thing1Id.'" thing2="'.$row['thing2Id'].'" user="'.$user->ID.'" class="runScript btn" >Run!</span></td></tr>'; 


jQuery.noConflict(); 
jQuery(document).ready(function(){ 
jQuery(".runScript").on("click",function(){ 
    var me = jQuery(this); 
    var thing1= me.attr("thing1"); 
    var thing2= me.attr("thing2"); 
    var user = me.attr("user"); 
    me.html("Working on it! Please wait!"); 
    jQuery.ajax({ 
     url: "/runScript?thing1=" + me.attr('thing1') + "&thing2=" + me.attr('thing2') + "&user=" + me.attr('user') 
    }).done(function(data) { 
     me.html("Done!"); 
     console.log(data); 
    }); 
+0

請點擊'<>'按鈕,創建一個[MCVE]與實際HTML – mplungjan

回答

0

試試這個:

jQuery(document).on("click", ".runScript", function() { 

}); 
+0

這只是必要的,如果「 runcript「元素在加載時不可用 – mplungjan

+0

OMG謝謝。最後工作。 – ngtess

相關問題