Redirecting IE6 Users - internet-explorer-6

I am searching for an IE6 code which will redirect users from our brand new web page to an older version.
for example something along these lines
<!--[if lte IE6]>
<a href="http://etterengineering.com">
<![endif]-->
Thank you!

<!--[if lte IE 6]>
<meta http-equiv="refresh" content="0;url=http://example.com/" />
<![endif]-->
Put this in the head of your page and change the URl to the correct one. This will work even if the user has disabled JS.
Note that meta refresh is discouraged due to some associated drawbacks, but for your purposes should be good enough.
The alternative is to return HTTP 302 for IE6 user agent.

Try this:
<!--[if lte IE6]>
<script type="text/javascript">
window.location.href = "http://etterengineering.com";
</script>
<![endif]-->

Related

How to use D3 and R2D3 in IE8

I searched online about the problem of using d3.js SVG under IE8, and I find an ideal method is using R2D3, and I tried to do like that, but it still doesn't work yet.
I am not sure what I have tried is right, do I only need to import the library like that?
<html>
<head>
<title>R2D3 101</title>
<!--[if lte IE 8]><script src="r2d3.js" charset="utf-8"></script><![endif]-->
<!--[if gte IE 9]><!-->
<script src="d3.js"></script>
<!--<![endif]-->
</head>
<body>
<h1>Hello, world!</h1>
</body>
</html>
And other things don't need to change? If you are interested, I can show you a simple demo about my treemap function.
http://jsfiddle.net/srvikram13/cR35x/9/
At first, I am thinking about if it is the problem of the limitations using Transforms as mentioned in the github: https://github.com/mhemesath/r2d3/
But the thing is, I really write the function as the GOOD one:
// BAD
circles.transform('translate(20)');
// GOOD
circles.transform('translate(20,0)');

Sublime Snippet Not Working

I was just trying to make some snippets but I can't get any of them to work. Can anyone see what's wrong with this? I read their docs and thumbed some examples off the web but they don't work either. I've got it in my /sublime text 3/packages/user folder and it's named using convention myTest.sublime.snippet.
The snippet is:
<snippet>
<content>
<![CDATA[
<!DOCTYPE html lang="en">
<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]><html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]><html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<title>${1:test1|test2|test3} | $2</title>
<meta name="viewport" content="width=device-width">
<meta name="Description" lang="en" content="Description">
<meta name="robots" content="index, follow">
<meta name="robots" content="noodp, noydir">
<!-- Twitter Bootstrap -->
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css" rel="stylesheet">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<script src="assets/js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
$3
</div>
</body>
</html>
]]>
</content>
<tabTrigger>page</tabTrigger>
<scope>source.html</scope>
<description>HTML5 Base HTML</description>
</snippet>
You should use text.html instead of source.html in scope block.
Sublime 3 needs snippets to have .sublime-snippet endings in file name.
Step1. For html snippet, please change
<scope>source.html</scope>
to
<scope>text.html</scope>
Step2. If you want sublime to show tooltips after you input the keywords, add this line
"auto_complete_selector": true
to your Preferences - Settings User file
You should escape dollar signs in your snippet. $ -> \$.
I had the same problem and what I did was :
Just remove <scope>source.html</scope> line present at the bottom of the snippet.
This is clearly an old thread, but it came up when I was searching on creating sublime snippets. The initial issue might be that you are typing in "page" as your tab trigger without first setting your syntax to html. You can do this quickly with shift + command/control + p then type sshtml then enter. Try your tab trigger again. Worked for me. Cheers.
Remove:
<description>HTML5 Base HTML</description>
Yes, this line comes from the official documentation, but at least in my instance (Sublime 3, Build 3114), it breaks the snippet. When I remove that line, the snippet works.
Also, as Jinglong above answered, add the following to your user preferences:
"auto_complete_selector": true
solved by..
removing <scope>source.html</scope>
adding "auto_complete_selector": true, to user settings
Background
My js/ snippets worked fine with <scope>source.html</scope> but for whatever reason, that line caused issues in my html/ snippets not.
I found the solution to my problem! I have been using the unicode setting for my keyboard for another project. When I changed my keyboard back to US, my problem was resolved. I'm sure this is an unusual issue, but in case anyone else is having this problem:
changing the keyboard back to US also reactivated some of the code navigation shortcuts (e.g., jumping word-to-word on a line by holding down option + arrow keys)

How to make a browser download external files after having loaded a page?

Alright, my question is pretty simple. Suppose I have a homepage that is not linked to any external stylesheets, all its styles being either inline or internal, how do I do so that AFTER the homepage has been downloaded and displayed, the browser then downloads any necessary (specified) external stylesheets. Is this possible?
Thank you.
Try This:
<head>
<script type='text/javascript'>
function addstyle()
{
document.getElementById('style').href='style.css';
}
</script>
<link rel="stylesheet" type="text/css" href="">
</head>
<body onload="addstyle()">
<h1>Welcome</h1>
<p>Hello whats up</p>
<p>Hope you will have a great day</p>
</body>

meteor real router for multi page apps without JavaScript render

I am new to meteor and I am trying to do multi-page application where http://www.mydomain.com/page1 will result a totally different page from http://www.mydomain.com/page2.
By totally different I mean that I don't want the page to be rendered by the client.
I tried to use meteor-router but What I got is something like:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/myapp.css?9297ad4aa173c4e0c19aebd27c62a5c43242bb93">
<script type="text/javascript">
__meteor_runtime_config__ = {"ROOT_URL":"http://localhost:3000","serverId":"iMp4kgzzeqDtktJoY"};
</script>
<script type="text/javascript" src="/packages/underscore/underscore.js?6d71e6711255f43c0de8090f2c8b9f60534a699b"></script>
<script type="text/javascript" src="/packages/meteor/client_environment.js?07a7cfbe7a2389cf9855c7db833f12202a656c6b"></script>
<script type="text/javascript" src="/packages/meteor/helpers.js?2968aa157e0a16667da224b8aa48edb17fbccf7c"></script>
...
...MANY MANY MANY SCRIPTS.... ?!?
...
...
<script type="text/javascript" src="/myapp.js?2866dcdb5c828b129cdd3b2498a4bf65da9ea43f"></script>
<title>myapp</title>
</head>
<body>
</body>
</html>
And this is not what I want. I want page1 route will return me:
<!DOCTYPE html>
<html>
<head>
My meta tags
</head>
<body>
page1
</body>
</html>
And I want page2 to return different meta tags with different content.
In order to be clear, lets assume that my clients sometime doesn't have javascript. I don't asking about whether meteor is the right framework! I am asking only if can I do this with meteor.
Meteor works a bit different compared to the traditional LAMP stack. Basically it works by patching out the DOM to only where the changes are needed as opposed to re-downloading the whole web page. It makes for a very satisfying end user experience on modern web browsers.
To use meteor router you need to find a spot that you want to patch out with new data for different pages with {{renderPage}}. You can use something like
<head>
<title>xx</title>
</head>
<body>
{{renderPage}}
</body>
<template name="page1">
<h2>Hello!</h2>
</template>
<template name="page2">
<h2>Ola!</h2>
</template>
Now you need to define a router in your client side javascript:
Meteor.Router.add({
'/page1': 'page1',
'/page2': 'page2'
});
So if you load /page1 you would see Hello! and if you load /page2 you would see Ola! as defined in the <template name="page2">..</template>
With the meta tags you need to use javascript to create them. With something like
$('head').append("<meta...");
Again this depends on your preference, personally I find these type of apps load ridiculously fast between web pages as compared to other 'thin' based websites. (Have a look at meteor.com to see how fast you can swap between the pages). The browser does need javascript, however.
Of note is in production mode there will only be 1 script tag.

Dreamweaver causing Quirks Mode in Internet Explorer

I use Dreamweaver to develop Web sites. I use the templates feature extensively as it helps to make things easier maintaining conformance.
However, I notice that Dreamweaver adds the following code before the doctype:
<!-- InstanceBegin template="/templates/web-public-user-home.dwt" codeOutsideHTMLIsLocked="false" -->
This is throwing my IE into Quirks mode for obvious reasons (i.e. comment before the doctype). Is there a way of dealing with this?! Below is my doctype.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Regards,
Ok, I figured this out.
Because of the extensive IE-compliance tweaking I'm doing, I was using conditional comments. However, I was using them on the html tag. There's nothing wrong with this in principle but Dreamweaver won't handle your live template updates properly when you do this (It will place the Dreamweaver-specific template lock code first before the doctype, thereby ensuring that your pages will throw Quirks mode in IE).
So what I did was move my conditional comment system away from the html tag, instead using them immediately after your opening body tag and immediately before your closing body tag like so:
<body>
<!--[if IE 6 ]> <div id="ie" class="ie6"> <![endif]-->
<!--[if IE 7 ]> <div id="ie" class="ie7"> <![endif]-->
<!--[if IE 8 ]> <div id="ie" class="ie8"> <![endif]-->
<!--[if gt IE 8 ]> <div id="ie"> <![endif]-->
<!--[if !IE]><div id="not-ie"> <![endif]-->
{YOUR HTML CODE}
</div>
</body>
This way, Dreamweaver places the doctype and html tag before the template lock code, and your resulting pages will appear in standards mode on IE (all things being normal).
Cheers.
Dreamweaver (incl. CS6) places the <!-- InstanceBegin template="... comment in front of the doctype tag only if it is unable to locate the opening <html> tag in your template! This happens when you forgot that tag altogether, but also when that tag is placed within conditional comments like this:
<!--[if IE 8]> <html class="ie8"> <![endif]-->
To avoid this you have to refrain from enclosing the <html> tag within conditional comments. When you use a normal undisguised <html> tag in your template code, Dreamweaver will automatically place the <!-- InstanceBegin template="... after that <html> tag in all files derived from that template and IE will not fall into quirks mode.

Resources