All of the sudden (at least so it seems), both Chrome and Firefox behave very strangely when it comes to viewing the source code of a web page. While normally I should be seeing the source like:
<!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" />
<title>Dynamic Map Application - HTML & JavaScript</title>
<link rel="stylesheet" type="text/css" href="resources/css/styles.css" />
<link rel="stylesheet" type="text/css" href="resources/css/colorbox.css" />
</head>
...
I now see it like (copied exactly as the browser shows it to me):
<!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" /><title>Dynamic Map Application - HTML & JavaScript</title> <style type="text/css" style="display:none">/**
* CSS Reset styles
*/
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;
}
...
As if the style sheets and scripts are not external.
This is not normal behavior and it did not happen before. And it's affecting how the browser caches external files (i.e. it doesn't).
Can anyone help with this issue?
Thanks in advance!
I had a similar problem that was caused by a proxy. Make sure you are not using one, directly or indirectly (perhaps your work place installed one).
Related
I have developed the Bookmarklet for Internet Explorer. It works fine when user load it on main browser page.
The issue is, it does not work on the Pop-Up Window of the application.
Most of my users, open the link inside the main page in pop-up, but the bookmarklet is triggered from Favorite window.
The bookmarklet link is not working in pop-up window.
Is there a way to achieve this ?
Try to use code below may help to solve your issue.
<!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" dir="ltr">
<head>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
<title>WhatsApp</title>
</head>
<body>
<script type="text/javascript">
javascript:(function(){open('https://Microsoft.com/','myWindow','toolbar=yes, menubar=yes, resizable=yes, width=650,height=900,top=0,left=1270');})()
</script>
</body>
</html>
The issue I have is the same as the 2 below:
Link 1
Link 2
The problem I have is that my app is an AngularJS page which use ui-router which is not supported in IE8.
To be able to correctly display SSRS report I have to add this meta to the root page:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
But this cause lots of issues with page display, I need to find different solution.
I was trying something like the below, but no luck:
<iframe class="ssrs-frame" type="text/html" ng-src="{{trustSrc(SSRS.url)}}" frameborder="0">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8">
<meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
</body>
</html>
Is there any way I could force Iframe only to emulate with IE8?
If you want to have specific CSS for IE8 you could use (inside head):
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="ie8.css">
<![endif]-->
That works. I don't know if HTML also allows this, you should test it:
<!--[if IE 8]><iframe></iframe><![endif]-->
Else you could create 2 iframes, 1 which you show for IE8 and 1 which does not. You could set display: block inside the ie8.css file for the specific iframe.
Hope this helps. Cheers
And once again I am stuck in the learning process. I am trying to animate a background of a site using the help provided here. But I am a little stuck. As I am teaching myself javascript (to replace basic actionscript). I like to write line by line instead of copying an pasting so I can understand how things work.
This is what I have so far:
<!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" />
<title>My Site</title>
<script type="text/javascript">
$(document).ready(function(){
window.alert("function started");
});
</script>
</head>
<body>
</body>
</html>
As you can see the alert window should pop up as the function is started, but it doesn't. Is there a reason why this happens or should I just set up a body onLoad function to handle what I want to do when the page loads?
You forgot to include the jQuery javascript API in your page. It should be included before you use the $() function (which is an alias for the jQuery() function in this case.)
If you check your browser's Javascript console you probably have an exception for trying to use undefined $. (In IE a handy trick while doing web development is to enable the Advanced option for "Display a notification for every script error," but this can get annoying when visiting other sites because lots of developers are lousy about identifying and fixing unhandled JS exceptions! Modern browsers usually use 'F12' (in the US at least), to open the developer tools for debugging Javascript, etc.)
Corrected code:
<!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" />
<title>My Site</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function ()
{
window.alert("function started");
});
</script>
</head>
<body>
</body>
</html>
This example uses the Google-hosted jQuery API, but you may also choose to download jQuery from http://jquery.com
Demo
http://jsfiddle.net/dvADs/
You are missing library reference~! like this
<script type='text/javascript' src='//code.jquery.com/jquery-2.0.2.js'></script>
Hope rest feeds your needs :)
Basics: http://jqfundamentals.com/chapter/jquery-basics
JQ CDN: http://jquery.com/download/
$(document).ready(function(){
window.alert("function started");
});
You are not first loading jQuery. jQuery is a library that you are trying to call by using the $. You can download it here: http://jquery.com/download/. Make sure you load jQuery before the javascript code.
I have validated this html. When I open it in a IE browser I cant see any alert. In other browsers I can. Any ideas why this is happening. HTML is valid according to http://validator.w3.org/check.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>hello</title>
</head>
<body>
<script type="text/javascript">alert("hallo");</script>
<div>Hello</div>
</body>
</html>
If you are opening the file locally in IE, you will a find confirmation message from IE saying
"Allow blocked content"
Click on it and your code will run.
I'm having this problem. I need to get the browser's window height, but $(window).height() returns much bigger numer, probably the document height. I have been using this document structure for years. Is there something wrong?
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs" dir="ltr">
<head>
...
What would be the cause?
Thanks
EDIT:
I have found where the error was. My text editor (PSPad) automatically enabled option of inserting UTF8 BOM at start of files. This leads to invisible characters before doctype. This gave me a hard time once before. But it was more visible back then. It took me two days to find out why is something wrong (images on page disappeared) and webkit browsers rendered head tag in body. Total mess. So now it works perfetly with all new versions of jQuery. Thanks for help.
You should get the height of the viewport if you use a more modern header :
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
If you really need XHTML, so you should use this :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
The doctype element must be the first thing in your document.