简体   繁体   English

jQuery .click()在safari上不起作用..但在其他浏览器上起作用

[英]Jquery .click() not work on safari.. but work on other browser

This code can run on chrome and firefox. 此代码可以在chrome和firefox上运行。 but just the safari cannot make it work... what's the problem now? 但是仅是野生动物园无法使其工作...现在有什么问题? jquery should be no problem to run at all browser.. jQuery应该可以在所有浏览器上运行。

the click function element is on the button tag. click功能元素位于button标记上。

 $( document ).ready(function() { $('#loading-icon').hide(); $('.complete-order').click(function() { $('#loading-icon').show(); $(function () { count = 0; wordsArray = [" Please wait... loading...", " Don't close your browser...", " We are setting up your website...", " Running the system..." , " Almost complete..."]; setInterval(function () { count++; $("#loading-icon span").fadeOut(400, function () { $(this).text(wordsArray[count % wordsArray.length]).fadeIn(400); }); }, 2000); }); }); }); 
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="text-center padding-loading"> <div id="loading-icon"> <i class="fa fa-spinner fa-spin"></i> <span> Please Wait... Loading...</span> </div> </div> <button type="submit" id="btnCompleteOrder" class="complete-order btn btn-primary btn-lg" onclick="this.value='{$LANG.pleasewait}'"> button<i class="fa fa-arrow-circle-right"></i> </button> 

I think you can try below code. 我认为您可以尝试以下代码。

$(document).on("click",'.complete-order',function(){
// You code
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM