前卫目录网

location.assign() 方法:重新加载页面到一个新的 URL (location)


文章编号:1567 / 更新时间:2024-12-30 14:11:30 / 浏览:
URL

location.assign() 方法重新加载页面到一个新的 URL (location)。

语法

location.assign(url)

参数

参数 描述
url 要加载的新 URL。

返回值

该方法不返回任何值。

示例

// 重新加载页面到一个新的 URL
location.assign("https://www.example.com");

完整的示例


03c/tr><h2>技术细节</h2><code>location.assign()</code> 方法会触发 <code>load</code> 事件。如果新 URL 与当前URL 相同,则不会触发 <code>load</code> 事件。<code>location.assign()</code> 方法不会改变浏览器的历史记录。要更改历史记录,请使用 <code>location.<a href="https://www.qianwe.com/article/c20fa17a47fa2f4a5cc0.html" target="_blank">replace</a>()</code> 方法。<h2>相关<a href="https://www.qianwe.com/article/23c79714d21770dc8eec.html" target="_blank">链接</a></h2>MDN Web Docs - location.assign()<a href="https://www.qianwe.com/article/dc4eef4f7d0931b19ce1.html" target="_blank">w3c</a> DOM Level 2 HTML - location</code></pre><br>
                      <meta content="always" name="referrer">
                                            <span>相关标签:</span>
                                            <a href="https://www.qianwe.com/search/%E9%87%8D%E6%96%B0%E5%8A%A0%E8%BD%BD%E9%A1%B5%E9%9D%A2%E5%88%B0%E4%B8%80%E4%B8%AA%E6%96%B0%E7%9A%84_wz.html" target="_blank">重新加载页面到一个新的</a>、                                            <a href="https://www.qianwe.com/search/location.assign_wz.html" target="_blank">location.assign</a>、                                            <a href="https://www.qianwe.com/search/%E6%96%B9%E6%B3%95_wz.html" target="_blank">方法</a>、                                            <a href="https://www.qianwe.com/search/URL_wz.html" target="_blank">URL</a>、                                            <a href="https://www.qianwe.com/search/location_wz.html" target="_blank">location</a>、                                                                  <p>本文地址:https://www.qianwe.com/article/fc63031d3ed5e4af73cf.html</p>
                      <p> <span>上一篇:<a href="https://www.qianwe.com/article/8fe836579b2b62abae11.html">JSON教程初学者指南json入门...</a></span>                        <br><span>下一篇:<a href="https://www.qianwe.com/article/11d411032ca14d1ddaf6.html">locationassign导航到指定URL,替换当前文档l...</a></span></p>
                    </div>
                  </div>
                </div>
              </div>
                                                                                                                                                                                                                  <div class="www_qianwe_com tab-block information-tab">
                <div class="www_qianwe_com tab-buttons">
                  <h3 class="www_qianwe_com tab-button cur" id="pinglun">发表评论</h3>
                </div>
                <div class="www_qianwe_com tabs">
                  <div class="www_qianwe_com tab-item active">
                    <form method="post" action="">
                      <input type="hidden" name="dingji" value="" id="dingji">
                      <div class="www_qianwe_com com-info">
                        <ul>
                          <li>
                            <input class="www_qianwe_com ipt" type="text" name="name" required="required" placeholder="昵称(必填)">
                          </li>
                          <li>
                            <input class="www_qianwe_com ipt" type="text" name="mail" placeholder="QQ/邮箱">
                          </li>
                          <li>
                            <button type="submit" name="pinglun" value="yes">发布评论</button>
                          </li>
                        </ul>
                      </div>
                      <div class="www_qianwe_com com-box">
                        <textarea name="text" placeholder="客官来都来了,说点什么吧..." cols="5" rows="5" required="required" id="textarea"></textarea>
                      </div>
                    </form>
                  </div>
                </div>
              </div>
                                      <div class="www_qianwe_com tab-block information-tab">
              <div class="www_qianwe_com tab-buttons ">
                <h3 class="www_qianwe_com tab-button cur" data-tab="one">温馨提示</h3>
              </div>
              <div class="www_qianwe_com tabs">
                <div class="www_qianwe_com tab-item active" id="tab-one">
                  <div class="www_qianwe_com information-tab">
                    做上本站友情链接,在您站上点击一次,即可自动收录并自动排在本站第一位!<br><span><strong><a href="https://www.qianwe.com/" target="_blank">前卫目录网</a></strong></span>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="www_qianwe_com right you sidebar">
                                                                                          <!-- 内容页短视频-->
      <div class="www_qianwe_com youe">
        <dl>
          <div class="www_qianwe_com player">
            <video id="player" controls class="www_qianwe_com playera">你的浏览器不支持HTML5播放此视频</video>
            <button id="lianxu">连续开启</button>
            <button id="huanyige"><i class="www_qianwe_com icon-share-alt mr-1"></i>再换一个</button>
          </div>
        </dl>
      </div>
      <!-- 内容页短视频-->
                  <div class="www_qianwe_com youe">
        <dl>
          <dt>相关推荐</dt>
          <dd>
            <ul>
                            <li><p><a href="https://www.qianwe.com/article/6c5cbe2e1e16aec70f8b.html" title="揭秘网站推广的秘诀:逐步指南和最佳实践 (揭秘网站推广案例)">揭秘网站推广的秘诀:逐步指南和最佳实践 (揭秘网站推广案例)</a></p></li>
                            <li><p><a href="https://www.qianwe.com/article/b9e747435d355070e9e9.html" title="福州网站优化秘籍:提升网站排名和流量的实战技巧 (麻烦各位童鞋,谁能赐教,福州网站建设企业哪家好?)">福州网站优化秘籍:提升网站排名和流量的实战技巧 (麻烦各位童鞋,谁能赐教,福州网站建设企业哪家好?)</a></p></li>
                            <li><p><a href="https://www.qianwe.com/article/451db57d1399141be0d1.html" title="网页制作费用:预算、成本和经济高效策略的综合指南 (网页制作费用大概多少)">网页制作费用:预算、成本和经济高效策略的综合指南 (网页制作费用大概多少)</a></p></li>
                            <li><p><a href="https://www.qianwe.com/article/85f33fc9c77731f2e7a1.html" title="自建站平台:打造强大且定制的在线业务 (自建站平台有哪些)">自建站平台:打造强大且定制的在线业务 (自建站平台有哪些)</a></p></li>
                            <li><p><a href="https://www.qianwe.com/article/22fd9f1d10ed73aa5bac.html" title="帮站seo (帮站点安装空调未签劳动合同合同)">帮站seo (帮站点安装空调未签劳动合同合同)</a></p></li>
                            <li><p><a href="https://www.qianwe.com/article/35ae0f9e58e7183f7910.html" title="seo理论知识 (seo技术原理)">seo理论知识 (seo技术原理)</a></p></li>
                            <li><p><a href="https://www.qianwe.com/article/2307bcfb1ce2aa4c257d.html" title="seo免费诊断 (seo检测在线)">seo免费诊断 (seo检测在线)</a></p></li>
                            <li><p><a href="https://www.qianwe.com/article/2996d9cd6503a3a754ff.html" title="重庆seo终极指南:优化网站,在竞争激烈的本地市场中脱颖而出 (重庆的seo服务公司)">重庆seo终极指南:优化网站,在竞争激烈的本地市场中脱颖而出 (重庆的seo服务公司)</a></p></li>
                            <li><p><a href="https://www.qianwe.com/article/e51927fe9a140742da77.html" title="苏州SEO指南:优化网站,让您的业务在搜索结果中大放异彩 (苏州seo服务)">苏州SEO指南:优化网站,让您的业务在搜索结果中大放异彩 (苏州seo服务)</a></p></li>
                            <li><p><a href="https://www.qianwe.com/article/c6b1da0b5de1a580d601.html" title="襄阳SEO服务:专业团队打造您的在线成功之路 (襄阳seo外包)">襄阳SEO服务:专业团队打造您的在线成功之路 (襄阳seo外包)</a></p></li>
                            <li><p><a href="https://www.qianwe.com/article/e4ce2971139c48e50069.html" title="淮南 SEO 全攻略:掌握关键词和内容策略 (淮南本地网站)">淮南 SEO 全攻略:掌握关键词和内容策略 (淮南本地网站)</a></p></li>
                            <li><p><a href="https://www.qianwe.com/article/5475f25f180b55626e23.html" title="通过百度关键词 SEO 优化,在搜索引擎结果中拔得头筹 (百度知道关键词)">通过百度关键词 SEO 优化,在搜索引擎结果中拔得头筹 (百度知道关键词)</a></p></li>
                            <li><p><a href="https://www.qianwe.com/article/ee7995265dccb4beddd4.html" title="pathinfo:文件路径解析函数 (python编程)">pathinfo:文件路径解析函数 (python编程)</a></p></li>
                            <li><p><a href="https://www.qianwe.com/article/aeb2d09a7aaeb08949e5.html" title="VBScript教程:深入浅出,从入门到精通 (vbscript 脚本编程)">VBScript教程:深入浅出,从入门到精通 (vbscript 脚本编程)</a></p></li>
                            <li><p><a href="https://www.qianwe.com/article/7f11c0e9ee81555e61e9.html" title="Bootstrap(bootstrap框架)">Bootstrap(bootstrap框架)</a></p></li>
                            <li><p><a href="https://www.qianwe.com/article/3c7a4e6cb04440253cfb.html" title="全面指导:深入了解 Matlab 编程 (深入,全面之类的词)">全面指导:深入了解 Matlab 编程 (深入,全面之类的词)</a></p></li>
                          </ul>
          </dd>
        </dl>
      </div>
                  <div class="www_qianwe_com youe">
        <dl>
          <dt>网址推荐</dt>
          <dd>
            <ul>
                            <li><p><a href="https://www.qianwe.com/links/0eac847acca72c3c15af.html" title="聚四氟乙烯">聚四氟乙烯</a></p></li>
                            <li><p><a href="https://www.qianwe.com/links/c411f1715ac7b953fa61.html" title="深圳">深圳</a></p></li>
                            <li><p><a href="https://www.qianwe.com/links/3856a17178af5f18296f.html" title="华大半导体">华大半导体</a></p></li>
                            <li><p><a href="https://www.qianwe.com/links/897c9d3632dc5c30344e.html" title="中国材料进展">中国材料进展</a></p></li>
                            <li><p><a href="https://www.qianwe.com/links/6367198478ec08a0559c.html" title="广东博纳融资租赁有限公司">广东博纳融资租赁有限公司</a></p></li>
                            <li><p><a href="https://www.qianwe.com/links/f4d29b56f5802a4c238b.html" title="印包圈">印包圈</a></p></li>
                            <li><p><a href="https://www.qianwe.com/links/14b3f9f862e74e10999c.html" title="沈家大院的影视基地">沈家大院的影视基地</a></p></li>
                            <li><p><a href="https://www.qianwe.com/links/df4103813736315e687a.html" title="程力集团">程力集团</a></p></li>
                            <li><p><a href="https://www.qianwe.com/links/5bc699499599c2442590.html" title="天津华创万达网络科技有限公司">天津华创万达网络科技有限公司</a></p></li>
                            <li><p><a href="https://www.qianwe.com/links/aee01f3155c8c6abf641.html" title="磁场">磁场</a></p></li>
                            <li><p><a href="https://www.qianwe.com/links/86237c4001b56c9758f8.html" title="软富云智慧养老">软富云智慧养老</a></p></li>
                            <li><p><a href="https://www.qianwe.com/links/82ac4072cb4f10cdb94e.html" title="一体化净水设备生产厂家">一体化净水设备生产厂家</a></p></li>
                            <li><p><a href="https://www.qianwe.com/links/bc2f29ec1e729c662655.html" title="传奇工具">传奇工具</a></p></li>
                            <li><p><a href="https://www.qianwe.com/links/246148be320d17b9600c.html" title="泰安网站制作">泰安网站制作</a></p></li>
                            <li><p><a href="https://www.qianwe.com/links/f73ff32fdef0a5fce7f1.html" title="影猫网">影猫网</a></p></li>
                            <li><p><a href="https://www.qianwe.com/links/5263e0c7d3afa15eec3d.html" title="白银投资">白银投资</a></p></li>
                          </ul>
          </dd>
        </dl>
      </div>
          </div>
  </div>
    <div class="www_qianwe_com col">
    <div class="www_qianwe_com card">
      <div class="www_qianwe_com card-header">
        <h5 class="www_qianwe_com card-title"><i class="www_qianwe_com fa fa-link fa-fw"></i>文章推荐</h5>
      </div>
      <div class="www_qianwe_com row no-gutters dhsl1">
        <ul>
                    <li>
            <p>
              <a href="https://www.qianwe.com/article/389a0af2b5fe6cef0194.html" target="_blank"><img src="https://www.qianwe.com/zdmsl_image/article/20250104194431_47331.jpg" height="85%" width="100%" title="" alt="零成本网络推广蓝图:打造引人入胜的在线形象,无需花一分钱 (零成本网络推广方案)" loading="lazy"></a>
              <a href="https://www.qianwe.com/article/389a0af2b5fe6cef0194.html" target="_blank">零成本网络推广蓝图:打造引人入胜的在线形象,无需花一分钱 (零成本网络推广方案)</a>
            </p>
          </li>
                    <li>
            <p>
              <a href="https://www.qianwe.com/article/d36fd0f9713f49117ca1.html" target="_blank"><img src="https://www.qianwe.com/zdmsl_image/article/20250104193703_41698.jpg" height="85%" width="100%" title="" alt="释放您的龙岩网站潜力:通过全面推广策略获得更多的流量和转化" loading="lazy"></a>
              <a href="https://www.qianwe.com/article/d36fd0f9713f49117ca1.html" target="_blank">释放您的龙岩网站潜力:通过全面推广策略获得更多的流量和转化</a>
            </p>
          </li>
                    <li>
            <p>
              <a href="https://www.qianwe.com/article/0f9a6c113c661b8e3475.html" target="_blank"><img src="https://www.qianwe.com/zdmsl_image/article/20250104191117_71874.jpg" height="85%" width="100%" title="" alt="Website Promotion Team: Unlocking Digital Success with Strategic Optimization(website中文翻译)" loading="lazy"></a>
              <a href="https://www.qianwe.com/article/0f9a6c113c661b8e3475.html" target="_blank">Website Promotion Team: Unlocking Digital Success with Strategic Optimization(website中文翻译)</a>
            </p>
          </li>
                    <li>
            <p>
              <a href="https://www.qianwe.com/article/fa3e934a86f8d598ed22.html" target="_blank"><img src="https://www.qianwe.com/zdmsl_image/article/20250104113850_27100.jpg" height="85%" width="100%" title="" alt="App Store 优化秘诀:如何让您的应用在众多竞争对手中脱颖而出并获得成功 (appstore)" loading="lazy"></a>
              <a href="https://www.qianwe.com/article/fa3e934a86f8d598ed22.html" target="_blank">App Store 优化秘诀:如何让您的应用在众多竞争对手中脱颖而出并获得成功 (appstore)</a>
            </p>
          </li>
                    <li>
            <p>
              <a href="https://www.qianwe.com/article/0887a92fe14955eea6d7.html" target="_blank"><img src="https://www.qianwe.com/zdmsl_image/article/20250103210601_61362.jpg" height="85%" width="100%" title="" alt="中国建筑工程行业领先资讯平台:中国建筑工程网 (中国建筑工程总公司)" loading="lazy"></a>
              <a href="https://www.qianwe.com/article/0887a92fe14955eea6d7.html" target="_blank">中国建筑工程行业领先资讯平台:中国建筑工程网 (中国建筑工程总公司)</a>
            </p>
          </li>
                    <li>
            <p>
              <a href="https://www.qianwe.com/article/27f611333704a91d852e.html" target="_blank"><img src="https://www.qianwe.com/zdmsl_image/article/20250103194037_11613.jpg" height="85%" width="100%" title="" alt="揭秘选择最佳网站建设公司的关键因素 (选择最好的)" loading="lazy"></a>
              <a href="https://www.qianwe.com/article/27f611333704a91d852e.html" target="_blank">揭秘选择最佳网站建设公司的关键因素 (选择最好的)</a>
            </p>
          </li>
                    <li>
            <p>
              <a href="https://www.qianwe.com/article/fe2169f5ea84fec05136.html" target="_blank"><img src="https://www.qianwe.com/zdmsl_image/article/20250103120248_58855.jpg" height="85%" width="100%" title="" alt="从头开始打造您的网站优化策略,聘请一家卓越的外包公司 (从头开始打造自己一艘军舰)" loading="lazy"></a>
              <a href="https://www.qianwe.com/article/fe2169f5ea84fec05136.html" target="_blank">从头开始打造您的网站优化策略,聘请一家卓越的外包公司 (从头开始打造自己一艘军舰)</a>
            </p>
          </li>
                    <li>
            <p>
              <a href="https://www.qianwe.com/article/65102e3f5ff5628304ea.html" target="_blank"><img src="https://www.qianwe.com/zdmsl_image/article/20250102222904_22277.jpg" height="85%" width="100%" title="" alt="零基础入门:用 HTML 从头构建静态网页的详细教程 (零基础入门会计)" loading="lazy"></a>
              <a href="https://www.qianwe.com/article/65102e3f5ff5628304ea.html" target="_blank">零基础入门:用 HTML 从头构建静态网页的详细教程 (零基础入门会计)</a>
            </p>
          </li>
                    <li>
            <p>
              <a href="https://www.qianwe.com/article/c39405c34897b62a9791.html" target="_blank"><img src="https://www.qianwe.com/zdmsl_image/article/20250102030838_43380.jpg" height="85%" width="100%" title="" alt="SEO优化工作内容 (SEO优化工程师)" loading="lazy"></a>
              <a href="https://www.qianwe.com/article/c39405c34897b62a9791.html" target="_blank">SEO优化工作内容 (SEO优化工程师)</a>
            </p>
          </li>
                    <li>
            <p>
              <a href="https://www.qianwe.com/article/3c1ac05842a01591b230.html" target="_blank"><img src="https://www.qianwe.com/zdmsl_image/article/20250101122101_72604.jpg" height="85%" width="100%" title="" alt="惠州seo报价 (惠州seo排名收费)" loading="lazy"></a>
              <a href="https://www.qianwe.com/article/3c1ac05842a01591b230.html" target="_blank">惠州seo报价 (惠州seo排名收费)</a>
            </p>
          </li>
                    <li>
            <p>
              <a href="https://www.qianwe.com/article/f2e2934e3ae21e99b3b3.html" target="_blank"><img src="https://www.qianwe.com/zdmsl_image/article/20250101075434_54971.jpg" height="85%" width="100%" title="" alt="关键词seo优化排名 (关键词seo如何优化)" loading="lazy"></a>
              <a href="https://www.qianwe.com/article/f2e2934e3ae21e99b3b3.html" target="_blank">关键词seo优化排名 (关键词seo如何优化)</a>
            </p>
          </li>
                    <li>
            <p>
              <a href="https://www.qianwe.com/article/44c6d718cfcdf5b36972.html" target="_blank"><img src="https://www.qianwe.com/zdmsl_image/article/20241231093221_36729.jpg" height="85%" width="100%" title="" alt="揭秘网站 SEO 优化费用:全面指南 (维基揭秘网站)" loading="lazy"></a>
              <a href="https://www.qianwe.com/article/44c6d718cfcdf5b36972.html" target="_blank">揭秘网站 SEO 优化费用:全面指南 (维基揭秘网站)</a>
            </p>
          </li>
                    <li>
            <p>
              <a href="https://www.qianwe.com/article/e687de404e9e62643f22.html" target="_blank"><img src="https://www.qianwe.com/zdmsl_image/article/20241231085735_40464.jpg" height="85%" width="100%" title="" alt="掌控云南 SEO:获得本地搜索引擎曝光率 (云南掌故)" loading="lazy"></a>
              <a href="https://www.qianwe.com/article/e687de404e9e62643f22.html" target="_blank">掌控云南 SEO:获得本地搜索引擎曝光率 (云南掌故)</a>
            </p>
          </li>
                    <li>
            <p>
              <a href="https://www.qianwe.com/article/d9ce6c7e9b185bdd7d7e.html" target="_blank"><img src="https://www.qianwe.com/zdmsl_image/article/20241231070942_13033.jpg" height="85%" width="100%" title="" alt="外链建设的全面指南:提升网站排名和权重的终极秘诀 (外链建设的全称是什么)" loading="lazy"></a>
              <a href="https://www.qianwe.com/article/d9ce6c7e9b185bdd7d7e.html" target="_blank">外链建设的全面指南:提升网站排名和权重的终极秘诀 (外链建设的全称是什么)</a>
            </p>
          </li>
                    <li>
            <p>
              <a href="https://www.qianwe.com/article/d155e17a954d45db761f.html" target="_blank"><img src="https://www.qianwe.com/zdmsl_image/article/20241230073510_56795.jpg" height="85%" width="100%" title="" alt="计算机编程语言 (计算机编程语言有哪些)" loading="lazy"></a>
              <a href="https://www.qianwe.com/article/d155e17a954d45db761f.html" target="_blank">计算机编程语言 (计算机编程语言有哪些)</a>
            </p>
          </li>
                    <li>
            <p>
              <a href="https://www.qianwe.com/article/f3154da15b4d4592a4f9.html" target="_blank"><img src="https://www.qianwe.com/zdmsl_image/article/20241230063947_87800.jpg" height="85%" width="100%" title="" alt="ActiveX 控件:揭示其用途、优点和安全隐患 (active什么牌子轮胎)" loading="lazy"></a>
              <a href="https://www.qianwe.com/article/f3154da15b4d4592a4f9.html" target="_blank">ActiveX 控件:揭示其用途、优点和安全隐患 (active什么牌子轮胎)</a>
            </p>
          </li>
                  </ul>
      </div>
    </div>
  </div>
    <div class="www_qianwe_com col footer">
  <div class="www_qianwe_com footer-wrap">
     <p>Copyright @ 2021-2025 <a href="https://www.qianwe.com/">前卫目录网</a> <span>此内容系本站根据来路自动抓取的结果,不代表本站赞成被显示网站的内容或立场。</span></p>
    <p>本页阅读量<span id="dangqian"></span>次 | 本站总访问<span id="quanju"></span>次 | 本站总访客<span id="zongshu"></span>人 | 今日总访问<span id="jinriip"></span>次 | 昨日总访问<span id="zuoriip"></span>次 |
      <a href="https://www.qianwe.com/sitemap.xml" target="_blank" rel="nofollow">网站地图</a> | <script charset="UTF-8" id="LA_COLLECT" src="//sdk.51.la/js-sdk-pro.min.js"></script>
<script>LA.init({id: "JhEwPIReXgVP8Pz4",ck: "JhEwPIReXgVP8Pz4"})</script>
<a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=41172402000155" >
 <img src="/zdmsl_include/images/gnicp.ico">  豫公网安备 41172402000154号</a> | <a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow">豫ICP备2021033894号-3</a></p>
      </div>
    <p>技术支持:<a href="http://www..qianwe.com/" target="_blank">前卫目录网</a></p>
  </div>
</div>
<script src="https://www.qianwe.com/zdmsl_templets/default/css/jquery.min.js"></script>
<script src="https://www.qianwe.com/zdmsl_templets/default/css/popper.min.js"></script>
<script src="https://www.qianwe.com/zdmsl_templets/default/css/bootstrap.min.js"></script>
<script src="https://www.qianwe.com/zdmsl_templets/default/css/custom.js"></script>
<script src="https://www.qianwe.com/zdmsl_templets/default/css/jq-public.js"></script>
<script src="https://www.qianwe.com/zdmsl_templets/default/css/pv.js"></script>

</div>
<script src="https://www.qianwe.com/zdmsl_templets/default/css/viewer.js"></script>
<script>
  viewer = new Viewer(document.getElementById('viewer'), {});
</script>
<!-- PHP Time:275 m Version:zdmsl-2025.1 -->
</body>
</html>