$(window).load(function()不起作用 [英] $(window).load (function() is not working

查看:110
本文介绍了$(window).load(function()不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$(窗口).load(function()在我使用锚标签从其他页面重定向此页面时无效....我的页面没有加载..我只能使用它而不是document.ready ..在此先感谢











$(window).load (function() is not working when i redirected this page from other page using anchor tag.... my page is not loading..i have to use this only not document.ready .. thanks in advance





<!DOCTYPE html>
<html>
<head>

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
<script>


$(window).load (function() {

//code goes here...

});//doc ready


</script>
<style>
*{padding:0; margin:0;}
ul {}
ul li {float:left; list-style:none; position:relative; }
ul li a.next {position:absolute; left:100px;}
ul li a.previous{position:absolute; left:0px;}
ul li a.startover{position:absolute; left:200px;}
</style>
</head>
<body>
<div>
<ul>
</ul>
</div>
<script>
</script>
</body>
</html>

推荐答案

(窗口).load(function(){

//代码在这里...

}); // doc ready


< / script >
< style >
* {padding: 0;保证金:0;}
ul {}
ul li {float:left;列表样式:无;位置:相对; }
ul li a.next {position:absolute; left:100px;}
ul li a.previous {position:absolute; left:0px;}
ul li a.startover {position:absolute; left:200px;}
< / style >
< / head >
< body >
< div >
< ul >
< / ul >
< / div >
< script >
< / script >
< / body >
< / html >
(window).load (function() { //code goes here... });//doc ready </script> <style> *{padding:0; margin:0;} ul {} ul li {float:left; list-style:none; position:relative; } ul li a.next {position:absolute; left:100px;} ul li a.previous{position:absolute; left:0px;} ul li a.startover{position:absolute; left:200px;} </style> </head> <body> <div> <ul> </ul> </div> <script> </script> </body> </html>


在html(所有设计代码)之后写下来



Write this after the html ( all design code )

<script>


(window).load(function(){

//代码在这里。 ..

}); // doc ready


< / script >
(window).load (function() { //code goes here... });//doc ready </script>


这篇关于$(window).load(function()不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆