简体   繁体   English

HTML5 iframe用法跳过加载中间html

[英]HTML5 iframes usage to skip loading intermediate html

I have a HTML page which I want to display on browser. 我有一个要在浏览器上显示的HTML页面。 This is a login page( https://localhost:9000/login ). 这是一个登录页面( https:// localhost:9000 / login )。 Before loading this over browser page I want to hit another url which gives me another html page . 在通过浏览器页面加载之前,我想点击另一个URL,这给了我另一个HTML页面。 This url is basically to kill the existing sessions.(https:xyz)But this also redirects me to another page which I don't want to display . 这个URL基本上是为了杀死现有的会话。(https:xyz)但这也将我重定向到另一个我不想显示的页面。 I want to remain on login page. 我想保留在登录页面上。

I think this is possible using iframes. 我认为使用iframe是可行的。 I am newbie to iframes. 我是iframe的新手。 Any pointers on how to achieve this? 关于如何实现这一目标的任何指针?

That's a local link only viewable on your computer. 这是本地链接,仅在您的计算机上可见。

So you want to load another page, before the login page? 因此,您想在登录页面之前加载另一个页面吗? If you want to kill existing sessions you can use sessionStorage for that. 如果要sessionStorage现有会话,可以使用sessionStorage

There are a few things that don't make sense with this, but it's your project. 有些事情对此没有任何意义,但这是您的项目。 like you want to redirect to another page, but don't want that page to display. 例如您想重定向到另一个页面,但又不想显示该页面。 That makes no sense to me. 这对我来说毫无意义。

You want to remain on login page, but when you login, you want to get another html page in the login page? 您想保留在登录页面上,但是登录时要在登录页面上获取另一个HTML页面吗?

iframes are probably the worst thing in the world imo... you got so much going on here, but can simplify this so much. iframe可能是imo世界上最糟糕的事情...您在这里进行了很多工作,但是可以简化很多工作。 A login page to an inner page and then you go from there. 登录页面到内部页面,然后从那里开始。

There are a number of ways to achieve the end means here, sessionStorage being one. 这里有多种方法可以实现结束方式, sessionStorage是其中一种。 Just search around here for answers, you can find a ton of them. 只需在这里搜索答案,就可以找到很多答案。

Good luck! 祝好运!

iframes have been removed from HTML specifications, you cannot use them in HTML5. iframe已从HTML规范中删除,您无法在HTML5中使用它们。

Use attribute target="_blank" in the <a> of this url. 在此URL的<a>中使用属性target =“ _ blank”。 It will open in a new tab 它将在新标签页中打开

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM