Jquery不在内容页面中使用C#ASP.NET Web表单 [英] Jquery is not working C# ASP.NET web form not in content page
问题描述
我有一个脚本在计时器的'onload'事件上运行section标签。它正在使用内容页面,但它不能与webform一起使用,任何人都可以建议我这个。
此计时器已在单独的javascript文件中完成
我的尝试:
I have a script to run section tag on 'onload' event for timer. It is working with content page but it is not working with the webform can anyone suggest me with this.
This timer has done in separate javascript file
What I have tried:
<script src="../Scripts/jquery-3.3.1.js"></script>
<script src="../Scripts/jquery-3.3.1.min.js"></script>
<script src="../Scripts/countdown.js"></script>
<script type="text/javascript">
$(function () {
$('section[onload]').trigger('onload');
});
</script>
这些脚本添加在head标签中,而不是在正文的结束标签中。
These scripts added in head tag not in closing tag of body.
<section style="width:20%;float:left;height:318px;margin:20px;position:fixed;" onload="startTimer()">
<div class="timer"></div>
</section>
此startTimer()方法用countdown.js文件编写。此文件在主内容页面中工作,但在webform中不起作用。如何实现这个
This startTimer() method is written in countdown.js file. This file is working in master content page but not in webform. How to achieve this
推荐答案
(function(){
(function () {
('section [onload]')。trigger('onload ');
});
< / script>
('section[onload]').trigger('onload'); }); </script>
这些脚本添加在head标签中,而不是在正文的结束标签中。
These scripts added in head tag not in closing tag of body.
<section style="width:20%;float:left;height:318px;margin:20px;position:fixed;" onload="startTimer()">
<div class="timer"></div>
</section>
此startTimer()方法用countdown.js文件编写。此文件在主内容页面中工作,但在webform中不起作用。如何实现这个
This startTimer() method is written in countdown.js file. This file is working in master content page but not in webform. How to achieve this
这篇关于Jquery不在内容页面中使用C#ASP.NET Web表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!