此代码可以在chrome和firefox上运行。但只是野生动物园无法使其发挥作用......现在的问题是什么?在所有浏览器上运行jquery应该没问题。
click函数元素位于按钮标记上。
$( 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>
&#13;
答案 0 :(得分:0)
我想你可以尝试下面的代码。
$(document).on("click",'.complete-order',function(){
// You code
});