亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

google scripts/html 試圖在頁面中顯示頁面

google scripts/html 試圖在頁面中顯示頁面

侃侃無極 2023-05-25 17:07:23
首先我要展示我的代碼,這是我正在運行的 html 代碼:<!DOCTYPE html><html>    <head>    <title>Elliots Site</title>    <base target="_top">    <?!= include('Gcss'); ?>      <script type="text/javascript">             </script>    </head>    <body>    <div class="page">      <iframe style="width: 100%; height: 100px; overflow: hidden;" src="http://google.com" width="100" height="100" scrolling="no">Iframes not supported</iframe>      <h1 class="emoj">"??"</h1>     </div>         <?!= include('Gjavascript'); ?>    </body></html>這是我的 css 文件:<style>    /* CSS reset */body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {     margin:0;    padding:0;}      html, body {  margin: 0;  padding: 0;}body {  font-family: 'Roboto', sans-serif;  font-weight: 100;}.page iframe {vertical-align:center;width=200%;height=100%;}.page .emoj {text-align:center;color:auto;vertical-align:center;}.page{background-color:white;align-items: center;height:400px;background-attachment: fixed;background-repeat: no-repeat;text-align:center;}<style>我還有兩個文件來運行代碼和應用 css 文件,我很確定這不是問題所在。第一個是 gs 文件,它是 js 的一種形式,代碼從 doGet 開始function doGet() {return HtmlService.createTemplateFromFile('gindex').evaluate();}function include(filename) {  return HtmlService.createHtmlOutputFromFile(filename)  .getContent();}另一個是html:<!DOCTYPE html><script>window.addEventListener('load', function() {  console.log('Page is loaded');});</script>好的,現在的問題。當前結果只是一個空白頁,甚至沒有打印文本。到目前為止,我還沒有嘗試過任何能取得很大成功的方法,到目前為止,我已經在 css 文件上工作以嘗試修復它。我做過研究,但在谷歌腳本上找不到太多。代碼的目標是在網站內部顯示谷歌主頁,我一直將其部署為網頁。這是我的第一篇文章如果您有任何問題我可以回答或測試請告訴我
查看完整描述

1 回答

?
慕勒3428872

TA貢獻1848條經驗 獲得超6個贊

你的代碼看起來有點混亂,因為它是如何提供的,所以為了演示目的,我自己做了。如果您想將 google.com 第一頁“嵌入”到您的網站,請使用 iframe 但不要使用 google.com,請嘗試使用此鏈接 => https://www.google.com/webhp?igu=1否則它會什么都不顯示。

PS 要預覽代碼,請使用全頁模式。

        

        .frame {

            height: 700px;

            width: 600px;

        }

        

        .page {

            text-align: center;

        }

        

        body {

            background-color: grey;

            height: 100vh;

            overflow: hidden;

        }

<!DOCTYPE html>

<html>


<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>IRONIXX</title>


</head>

<body>

    <section class="page">

        <h1 class="emoj">"??"</h1>

        <iframe class="frame" src="https://www.google.com/webhp?igu=1" frameborder="0"></iframe>

    </section>

</body>


</html>


查看完整回答
反對 回復 2023-05-25
?
不負相思意

TA貢獻1777條經驗 獲得超10個贊

我知道這不能直接解決您的空白頁面情況,但如果您有興趣在您的網站中嵌套另一個網站,也許您會對使用 iframe感興趣?

這是一個發電機。嘗試打卡google.com,看看是否可以將其嵌入到您的站點中。


查看完整回答
反對 回復 2023-05-25
  • 1 回答
  • 0 關注
  • 186 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號