gpt4 book ai didi

javascript - XML 表达式中缺少 }

转载 作者:行者123 更新时间:2023-12-02 20:30:00 26 4
gpt4 key购买 nike

我正在尝试更改我们的网站,以使用 .load() 函数通过 jquery 加载 header ,但为此我需要设置页面的标题。

从另一个 StackFlow 问题中,建议做一些简单的事情

$(document).ready(function() {
document.title ='Name Changed to Protect the Innocent';
});

当我这样做时,我收到了 Firebug 错误 Missing } in XML Expression对于脚本中的该行

我确信可能有一个简单的解决方案,但我肯定没有想到。

最佳答案

我刚刚对此进行了测试 here ,请查看您是否以相同的方式创建了 html 文档。代码如下。

    <html>
<head>
<title>Old Title</title>
<script type="text/javascript" src="jquery-1.4.2.js"></script>

</head>
<body>

<script type="text/javascript">
$(document).ready(function() {
document.title ='Name Changed to Protect the Innocent';
});
</script>
</body>
</html>

关于javascript - XML 表达式中缺少 },我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4315233/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com