Problem with displaying french character in IE - javascript

I have to display "sélection?" in one of page that is viewed via iframe. But this is getting rendered as "s�lection?". If I view it requesting the page then it is rendering properly.
But if I view it in an iframe it gets changed. Same thing is happening in Firefox and Chrome.

Just write sélection.
What's happening is that your browser is displaying the page in another encoding (eg ISO-8859-1 instead of UTF-8). There are multiple reasons why this can happen:
The tag in your <head> says so.
The tag in the webservers response headers says so.
The browser is setup to override the formatting on the page.
If it works on the page itself, but when the page is in an iframe, check the encoding of the page containing the iframe. It will probably differ. Look for this kind of tag:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
And make sure they are the same on both pages (hint: you should probably be using UTF-8)

Do you have the right charset?
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

Along with the meta tag <meta http-equiv="Content-Type" content="text/html; charset=utf-8">, I convert the document to UTF-8, you have all kind of software to convert it to you (dreamweaver, textedit, etc).

Related

Automaticaly reload html page only when a picture has been changed

I have a simple presenter when my PC is not compatible with a data projector. I make a print-screen of my local PC and upload it to my web page via FTP. It is working automatically, no problem (Linux).
But I would like to change following file to reload only when the program sees that the picture "web_presentation.png" has been changed (uploaded anew). The problem is that this page is constantly blinking while reloading every 10 s - it is annoying.
<html>
<head>
<title>web_presentation</title>
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<meta Name="Keywords" Content="redirect">
<meta Name="description" Content="redirect">
<meta http-equiv="Refresh" content="10; URL=web_presentation.htm">
</head>
<BODY>
<img src=web_presentation.png width=100%>
</body>
</html>
This page is displayed on a second PC, which is connected to the data projector (usually windows).
I spend a few hours to figure out how to get modification time (lastmodified) of web_presentation.png and reload it according to this information.
If possible, please stick to pure javascript or php (Firefox).
It seems to be much more difficult as I thought it would be.
Thanks :-)

Overriding masterpage <meta http-equiv="X-UA-Compatible" content="EmulateIE8"/> tag

I have a master page with this tag <meta http-equiv="X-UA-Compatible" content="EmulateIE8"/> . Problem is my screen within master page runs angularjs 1.4, and was developed for chrome. Now I'm told IE must also work. We run IE 11 but master page forces IE8 compatibility. Is there any way to OVERRIDE this (temporarily preferably)? when my screen (via wicket) is loaded?
simply placing <meta http-equiv="X-UA-Compatible" content="EmulateIE11"/> in my HTML has no effect, also tried a java filter applying this, but the master page seems to take precedent.
Any help desperately appreciated!
EDIT -
would this work in my master page:
<meta http-equiv="X-UA-Compatible" content="IE=8, IE=9, IE=10, IE=11" >
?

Does it Make Sense to Insert the Google Content Experiements Tag after <meta> tags?

Google instructs us to put the Content-Experiments JavaScript immediately after the <head> tag.
Does it make sense to actually insert it a little later than that, such as after some key compatibility <meta> tags, like:
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge;" />
<!-- Other important tags? -->
<!-- Google Analytics Content Experiment code -->
...
... or is it totally and absolutely best to put the JavaScript above all else?
This should be fine, so long as it's not nested within any other tags. It's the same case with the GTM snippet - ideally it should come immediately after the <body>, but often there are other meta tags the come before (and that may be loaded dynamically). Just make sure you validate the code after you've pasted it in on your site.
Google instructs you do place the experiment snippet as early as possible in the page because content experiments redirect to the variation pages. If you load assets before the experiment code there might be an unpleasant delay before the redirect starts.
I can for the love of my life not image that meta-tags would delay a js redirect, so you should be fine. I image Google found it easier to say "always on top" than "always on top except for tags that do not delay javascript executions (such as e.g. meta tags)".
Having said that, there is no benefit from having meta tags first, so you might as well put the experiment code first.
I found a specific case where it is actually very important to place the Google Analytics Content Experiments stuff AFTER certain <meta> tags.
I use a "dynamically triggered" Content Experiments, and thus, leave a great big JS block at the top. However, that block MUST come after <meta http-equiv="X-UA-Compatible" content="IE=edge" /> (or whatever IE version you like). The consequence of having Content-Exp after the <meta> tag is that IE will drop down to old-school corporate compatibility mode (IE7 behaviour) when navigating to websites that are incorrectly believed to be part of the Local Intranet zone.

GWT application is not showing in IE

I have a GWT 2.6 app which works fine on every browser except in IE (IE11). I am compiling application for all browsers. Using developer tools (console posts) i can see that application does load as it should be, but the page is blank and nothing is shown. No error appears in console and there is only a warning...
HTML1524: Invalid HTML5 DOCTYPE. Consider using the interoperable form "<!DOCTYPE html>".
File: user, Line: 1, Column: 1
...concerning application HTML file. I removed all Views and Widgets and left only basic view with some background and picture, and it still does not load properly only in IE.
I tried adding
<meta http-equiv="X-UA-Compatible" content="IE=5,6,8,9" >
to app html file but it doesn't make a difference nor does a Compatibility View settings and changing Document Type. I really do not care so much about app working in older IE versions, but >9 is preferable.
What am i missing here?
EDIT:
Actually the problem was having DockLayoutPanel in my View. Changed DockLayoutPanel into DockPanel and the application appeared (with some differences comparing to UI in other browsers).
Make sure that your html host page is properly formatted. It should start with the DOCTYPE declaration, followed immediately by <html> tag:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
...

base tag has no effect over <META HTTP-EQUIV="Refresh" [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to detect if JavaScript is disabled?
I need to detect whether javascript is disabled in browser.
To do so I have put an iframe inside the document and refreshing the page in a interval of 10sec. Once script is disabled, it has to redirect the top parent with javascript error URL. Here is my code for iframe:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href="http://localhost/test/" target="_top" />
<noscript>
<meta http-equiv="refresh" content="1; URL=http://localhost/test/javascript_error.php" />
</noscript>
<meta http-equiv="refresh" content="10" />
<title>Detect Script</title>
</head>
<body style="text-align:center;">
Detecting whether javascript script is enabled/disabled in the browser.
</body>
</html>
I'm adding the tag to the content of an iframe html and a redirect meta tag, which should load to the top parent location.
Any idea why this does not work?
or how do i get this thing to work?
Thanks
The base tag affects only elements with URLs that appear as the content of an attribute designated to have a URL value, such as href.
The constructive approach to dealing with JavaScript enabled/disabled is to first design a page assuming that JavaScript is disabled, then add JavaScript in a non-obtrusive way.
UPDATE: I see what you are trying to do. The base tag will only work with links. Since this only is done when JavaScript is disabled, the href of the iframe cannot possibly change and you cannot possibly 'programmatically click' a link which may reference to that JavaScript error page, there is really no possible solution using base. Refer to my solution below.
The reason that your code doesn't work is because most browsers would not render 2 <meta http-equiv="refresh"> tags separately.
So instead of writing <meta http-equiv="refresh" content="10" />, just write:
<script type="text/javascript">
setTimeout(function () {
window.location.reload();
}, 10000);
</script>

Categories