jQuery在OBS上有效,但在浏览器上无效

问题描述

我在使用JQuery时遇到问题。如果在HTML页面中使用它,则只有当我通过OBS(流媒体平台,是)查看该页面时,它才能正常工作。如果我通过浏览器打开同一页面,将无法正常工作。

示例:这是test.html。它与jquery-3.5.1.min.jstest2.html

位于同一文件夹中
<html>
    
<head>

    <script type="text/javascript" src="jquery-3.5.1.min.js"></script>
    
    <script>
        $(document).ready(function(){
            $('#asd').load("test2.html");
        });
    </script>
    
</head>

<body bgcolor="white">

    <div id="asd">
    </div>

</body>
</html>

这是test2.html

<html>

<head>
</head>

<body>
    
    asdhasdhashdashdhasdhasdhasdhasdhashdashd asdh asdha sdh asdh asdh asdh asdh asdh asdhds ahsd sdha sd
    
</body>

</html>

例如,这是我在Firefox上看到的内容

Firefox

这是我在OBS上看到的:

OBS

我试图通过其他浏览器(Edge,Opera)打开它,这是相同的。

我试图通过JQuery创建一个“ Hello World”,它确实有效,所以我真的不确定目前缺少什么:

<html>

<head>

    <title>jQuery Hello World</title>

    <script type="text/javascript" src="jquery-3.5.1.min.js"></script>

</head>

<body>

    <script type="text/javascript">

    $(document).ready(function(){
        $("#msgid").html("This is Hello World by JQuery");
    });

</script>

This is Hello World by HTML

<div id="msgid">
</div>

</body>
</html>

结果:

Firefox 2

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)