[英]HTML + Load one html partial inside another html page using Jquery Load Function
[英]passing value from one html to another using jquery load function
我陷入了一个奇怪的问题。 我使用的代码在一页中可以正常工作,但在另一页中却无法工作。 我尽力了,甚至更改了文档标题以匹配正在工作的页面,但没有一个适合我。 然后,我创建了一个新页面,只键入了传递内容的编码,但是它在新页面中也不起作用。 我完全感到困惑,不知道该怎么办。
码:
<head>
<script type="text/javascript">
$(document).ready(function(){
$('#bill2').load('http://website.com/fare.html #bill2')
})
</script>
</head>
<body>
<fieldset id="bill2">
</fieldset>
</body>
此代码在一页中有效,而在另一页中无效,请告诉我是否缺少某些内容?
试试这个,让我知道-
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#bill2').load('http://website.com/fare.html#bill2');
});
</script>
</head>
<body>
<fieldset id="bill2">
</fieldset>
</body>
这不是答案,但我认为我不应该在评论中写这个。
试试这个完整的语法来找出错误
$("#success").load("xxx.php", function(response, status, xhr)
{
if (status == "error")
{
var msg = "Sorry but there was an error: ";
$("#error").html(msg + xhr.status + " " + xhr.statusText);
}
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.