You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

为何从GitHub获取的JavaScript表单无法正常运行?

问题:嵌入GitHub存储的JavaScript表单失效

我想在个人网站展示存储于GitHub中的JavaScript表单,但浏览器会直接跳过表单内容,转而显示noscript标签的内容;移除noscript标签后,表单依旧无法正常工作。

效果对比

  • 预期效果:
    表单预期效果
  • 当前实际效果:
    当前实际效果

我的当前代码

<!DOCTYPE html>
<html>
<head>
    <title>js test</title>
    <meta charset="utf-8">
    <script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script>

</head>
<body>
    <div id="index_block"></div>
    <button onclick="hello()"><a>get data</datagrid></a></button>
    
</body>
<script>
    function hello(){
    $.ajax({
        url:'https://raw.githubusercontent.com/Rduanchen/hserpsystem/edfc042eec06225eb818f1db2ea77a8f768262b3/WEB_2/sub_index_web/Serch_general.html',
        method:'get',
        dataType:'Text',
        success:function(data){
            console.log(typeof(data));
            $(document).ready(function(){
                document.getElementById('index_block').innerHTML=data;
            })
        },
    });
};
</script>
</html>

内容的提问来源于stack exchange,提问作者Rduan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.22 15:54:36