[英]google scripts/html trying to display page within page
First I am going to show my code, this is my html code that's running:首先我要展示我的代码,这是我正在运行的 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>
And this is my css file:这是我的 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>
I also have two more files to run the code and apply the css file, which I am pretty sure is not the issue.我还有两个文件来运行代码并应用 css 文件,我很确定这不是问题。 This first one is a gs file which is a form of js the code starts at doGet
第一个是一个 gs 文件,它是一种 js 形式,代码从 doGet 开始
function doGet() {
return HtmlService.createTemplateFromFile('gindex')
.evaluate();
}
function include(filename) {
return HtmlService.createHtmlOutputFromFile(filename)
.getContent();
}
and the other one which is html:另一个是 html:
<!DOCTYPE html>
<script>
window.addEventListener('load', function() {
console.log('Page is loaded');
});
</script>
Okay now the question.好的现在问题。 The current result is just a blank page, and its not even printing the text.
当前结果只是一个空白页,甚至没有打印文本。 so far i haven't tried anything that led to much success, so far i have worked on the css file to try to fix it.
到目前为止,我还没有尝试任何可以取得很大成功的方法,到目前为止,我一直在研究 css 文件以尝试修复它。 I have done research, but couldn't find much on google scripts.
我做了研究,但在谷歌脚本上找不到太多。 the goal of the code is to display google homepage inside of the site, I have been deploying it as a web page.
代码的目标是在网站内显示谷歌主页,我一直将其部署为网页。 This my first post If you have questions I could answer or test for please let me know
这是我的第一篇文章如果您有问题我可以回答或测试,请告诉我
I know this doesn't solve your blank page scenario directly, but if you're interested in nesting another site within yours perhaps you'd be interested in using an iframe instead?我知道这并不能直接解决您的空白页面情况,但是如果您有兴趣在您的网站中嵌套另一个网站,也许您会对使用iframe感兴趣?
Here's a generator .这是一个发电机。 Try punching in
google.com
and see if you can embed it in your site.尝试在
google.com
打卡,看看是否可以将其嵌入您的网站。
Your code looks a bit messy by how it's provided so for demo purposes I made my own.你的代码看起来有点乱,所以为了演示目的,我自己做了。 If you want to "embed" google.com first page to your site then use iframe but instead of using google.com try to use this link => https://www.google.com/webhp?igu=1 otherwise it will show nothing.
如果您想将 google.com 第一个页面“嵌入”到您的网站,请使用 iframe 但不要使用 google.com 尝试使用此链接 => https://www.google.com/webhp?igu=1否则它会什么都不显示。
PS To preview code use full-page mode. PS 要预览代码,请使用整页模式。
.frame { height: 700px; width: 600px; } .page { text-align: center; } body { background-color: grey; height: 100vh; overflow: hidden; }
<!DOCTYPE html> <html lang="en"> <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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.