第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

Iframe:設(shè)置 document.location 2x 后白屏

Iframe:設(shè)置 document.location 2x 后白屏

浮云間 2023-08-05 20:43:26
我正在創(chuàng)建一個(gè) Web 應(yīng)用程序,旨在將其嵌入到我的 Wix 網(wǎng)站中。我需要的網(wǎng)絡(luò)應(yīng)用程序基本上可以簡(jiǎn)化為一個(gè)文本屏幕和一個(gè)按鈕來更改屏幕視圖/頁面(顯示的html)。然而,問題是,無論我是從“主頁”還是從“頁面”開始,應(yīng)用程序都會(huì)加載兩個(gè)下一個(gè)屏幕,并在之后給我一個(gè)白屏。我還嘗試了其他更改 url 的選項(xiàng) - ie等location.href,window.location甚至嘗試通過更改頁面<a href= URL,但問題仍然存在。下面是我的代碼的簡(jiǎn)化:頁面 HTML    <!DOCTYPE html>    <html>        <script src="https://apis.google.com/js/platform.js" async defer></script>              <head>    <base target="_self">        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>        <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">        </head>      <body>          <h1>page page</h1>              <button id="pagebtn" class="font-family: Raleway; font-size: 16px; waves-effect waves-light btn-small  blue accent-2"><i class="material-icons left">check</i> Navigate to home </button>          <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>        <script>         document.getElementById("pagebtn").addEventListener("click",changepage);        function changepage(){              var url_new = "https://script.google.com/macros/s/AKfycbzKN9vYBa1yQguooTnijIipyMdAMbXo7a61wjWHt0ybCynH2bxj/exec?v=home";       document.location = url_new;    }            </script>       </body>    </html>主頁 HTML    <!DOCTYPE html>    <html>        <script src="https://apis.google.com/js/platform.js" async defer></script>              <head>        <base target="_self">         <meta name="viewport" content="width=device-width, initial-scale=1.0"/>        <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
查看完整描述

1 回答

?
楊魅力

TA貢獻(xiàn)1811條經(jīng)驗(yàn) 獲得超6個(gè)贊

我通過將 document.location 更改為 window.top.location 解決了我的問題

但是,由于我需要將其嵌入到我的網(wǎng)站中,因此每當(dāng)(畢竟是 window.top)、每當(dāng)單擊“導(dǎo)航”按鈕時(shí),它都會(huì)打開一個(gè)新窗口 - 它不會(huì)按預(yù)期工作,但作為臨時(shí)修復(fù),它會(huì)做


查看完整回答
反對(duì) 回復(fù) 2023-08-05
  • 1 回答
  • 0 關(guān)注
  • 156 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)