how to retrieve URL into GSP - html

i am trying to show a content in iframe..it works at localhost
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><g:message code="default.list.label" args="[entityName]"/></title>
</head>
<body>
<div class="body">
<iframe style="width: 100%;min-height: 400px;height: 600px" src="https://www.google.com" />
</div>
</body>
</html>
but when i build a war and deploy it to server...that page was blank?
why?

Because Facebook doesn't allow it:
curl -v https://www.facebook.com
...
< X-Frame-Options: DENY
...
With DENY value:
The page cannot be displayed in a frame, regardless of the site
attempting to do so.
Google and many other sites have similar configuration, so please check for header. Also, you could open Chrome Developer Console, and check for errors
See docs for this header: https://developer.mozilla.org/en/The_X-FRAME-OPTIONS_response_header

Related

Why does my Edge favicon not work whereas the it does on Chrome?

I have a simple block of html running on a local Windows PC
<html>
<head>
<title>FavIcon Test</title>
<link id='favicon' rel='icon' href='favicon.ico' type='image/x-icon'/>
</head>
<body style='margin-left:10px'>
Hello World
</body>
</html>
I have grabbed a random website favicon file* and saved it to the same location as the html and have run it in Chrome and in Edge; Chrome shows me the expected site-icon, whereas Edge fails to show it.
What is going on?
Thanks
Abe
*e.g. go to https://ico.org.uk/favicon.ico and then right click on the result to [Save Image As...]
The favicon won't show on Edge Legacy in local server due to incomplete headers returned from server and Edge cannot access localhost because of some Windows security settings. For detailed information you coulde refer to this answer.
The issue will be fixed if you deploy the site to a web server or using an absolute global http-address favicon href. The following code will work on Edge Legacy:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>FavIcon Test</title>
<link id='favicon' rel='icon' href='https://ico.org.uk/favicon.ico' type='image/x-icon' />
</head>
<body style='margin-left:10px'>
Hello World
</body>
</html>

HTML meta http-equiv not showing up

I'm a little bit confused, because the HTTP header I'm trying to set is not showing up when I try to inspect the HTTP response headers with curl or Chromes developer tools.
I set the following header(s):
<html>
<head>
<meta http-equiv="set-cookie" content="the_name=some_value; path=/" />
</head>
<body>
<p>Hello World.</p>
</body>
</html>
I also tried to set the following header:
<meta http-equiv="refresh" content="2;URL=http://www.example.com" />
If I set a header with PHP, it shows up:
<head>
<?php header("refresh:2; URL=site.php"); ?>
</head>
Why do the HTTP headers I try to set via HTML do not show up with curl -I or with Chrome's developer tools, what am I doing wrong?
http-equiv tries to be equivalent to an HTTP header, it is not a way to set a real HTTP header.
Since it isn't a real HTTP header so won't show up if you look at the real HTTP headers.
It isn't really equivalent, there are many limitations
set-cookie is not a valid value for http-equiv
I don't have the tools to try this out at this second, but try changing the end of the tags to the proper version.
XML:
" />
HTML:
">

Upload page after navigating back

Hi, everybody.
I have a web page that contains link to another resource and a frame which updates every second (by another program). When I follow the link and then back (with browsers's back button), frame stops being updated.
I have tried to add <meta http-equiv="cache-control" content="no-cache" />
to both files but it hasn't work. Here are my code files:
index.html
<html>
<body>
Link
<iframe src="iframe.html"></iframe>
</body>
</html>
iframe.html
<meta http-equiv="refresh" content="1">
<div style="background-color: #250A69; color:#F0F0F0">
Hello, I'm frame
</div>
I need solution with HTML, but can't find it anywhere, please help.

iframe returns homepage instead of external file

I'm trying to embed a html5 banner created in Adobe Edge, the simplest way I could think of was dumping all the code edge spits out onto the ftp and then using an iframe to point at the html file. If I do this locally on my machine it works fine, if I try it on our live site the top left corner of the website is what appears in the iframe instead of the banner. It's a Joomla 1.5 site I have no idea what would cause this as I've not used iframes before. I've edited the code so it no longer has spaces.
Here is my website: www.webchild.com.au
and here is the iframe code:
<iframe src="/stdAds/html5/bilby-test/bilby_theatrical_banner.html" width="300" height="250" frameborder="0" scrolling="no"></iframe>
The code inside the html file is:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<title>Bilby Theatrical Productions Banner</title>
<!--Adobe Edge Runtime-->
<script type="text/javascript" charset="utf-8" src="bilby_theatrical_banner_edgePreload.js"></script>
<style>
.edgeLoad-EDGE-380725615 { visibility:hidden; }
</style>
<!--Adobe Edge Runtime End-->
</head>
<body style="margin:0;padding:0;">
<div id="Stage" class="EDGE-380725615">
</div>
</body>
</html>
Try removing the spaces out of your link. It may well be the %20's replicating the spacebar are screwing up the link. Else have you checked the html file your including is definately in the correct location on your FTP. If you just try going straight to the link ( http://www.webchild.com.au/stdAds/html5/bilby-test/Bilby%20Theatrical%20Banner.html ) you can see there is a 404 error which is probably why the top of your site is appearing - the 404 error page rather than the page

How to clear HTML content already sent to the browser, without JavaScript?

Bugzilla, Mozilla's issue tracker, has a nice loading screen while the search is being executed. In the days of Ajax, this is nothing special. They do it without any scripting, though, and I want to know how.
For example:
Disable JavaScript
Open the following URL: https://bugzilla.mozilla.org/buglist.cgi?short_desc=IDL&resolution=---&resolution=DUPLICATE&query_format=advanced&short_desc_type=allwordssubstr
You get a page with an animated image, the text "Please wait while your bugs are retrieved." and a title of "Bugzilla is pondering your search".
Update:
This is the entire DOM while the search is being executed. No meta refresh, no scripts.
<html>
<head>
<title>Bugzilla is pondering your search</title>
</head>
<body>
<div style="margin-top: 15%; text-align: center;">
<center>
<img width="160" height="87" alt=""
src="extensions/BMO/web/images/mozchomp.gif">
</center>
<h1>Please wait while your bugs are retrieved.</h1>
</div>
</body>
</html>
After a while, the results page appears. The previous HTML vanishes and a completely new DOM appears, including a new title "Bug List".
So my question is: how does this work exactly? Please don't list alternative techniques - I am not interested in loading screens at all, but want to use that exact mechanism for something completely different.
if you look at the souce of the page you see you actually get two responses each with its own header
WARNING: YOUR BROWSER DOESN'T SUPPORT THIS SERVER-PUSH TECHNOLOGY.
--------- =_y97AELt1tHMqcK8D
Content-Type: text/html; charset=UTF-8
<html>
<head>
<title>Bugzilla is pondering your search</title>
</head>
<body>
<div style="margin-top: 15%; text-align: center;">
<center><img src="extensions/BMO/web/images/mozchomp.gif" alt=""
width="160" height="87"></center>
<h1>Please wait while your bugs are retrieved.</h1>
</div>
</body>
</html>
--------- =_y97AELt1tHMqcK8D
Content-Type: text/html; charset=UTF-8
content-disposition: inline; filename="bugs-2011-08-30.html"
Set-Cookie: {data}
Set-Cookie: {data}
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Bug List</title>
{the rest of the request}
I'm not too sure about the browser support for this except for mozilla...
Use a meta refresh tag to reload the page every N seconds.
Return the "please wait page" (with the meta tag) as long as the search results are collected.
Return the results page (without the meta tag) when the results are ready.
You should be able to see what is happening when you open Firebug (or similar) and open the Network tab.