Aria Templates browser compatibility [closed] - ariatemplates

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 9 years ago.
I tried to run a simple code using Aria Templates. In mozilla it is working fine. In chrome, I am facing "Origin null is not allowed by Access-Control-Allow-Origin" and IE7 is not displaying anything and at the same time not throwing any error(that we usually see in footer).
Here is the code:index.html:
<html>
<head>
<title>
Aria Templates
</title>
<script type="text/javascript" src="aria/ariatemplates-1.3.6.js"></script>
<script type="text/javascript" src="aria/css/atskin-1.3.6.js"></script>
</head>
<body>
<div id="output"></div>
<script type="text/javascript">
Aria.loadTemplate({
classpath: 'view.Hello',
div: "output",
data: {
greeting: "Hello",
people: ["John", "Paul", "George", "Ringo"]
}
});
</script>
</body>
</html>
and Hello.tpl:
{Template {
$classpath: "view.Hello"
}}
{macro main()}
<h1>Hello Fab Four World</h1>
{foreach name in data.people}
${data.greeting} ${name}!<br/>
{/foreach}
{/macro}
{/Template}
The files are in same drive. Hello.tpl is placed inside view folder and html file is placed outside view along with aria folder.

Due cross domain issue the Aria Template JS doesn't load locally. Use some server which can give you option to run code from server
You can use Mongoose Server https://code.google.com/p/mongoose/

Related

why css file include in header section but js file in the bottom [duplicate]

This question already has answers here:
JavaScript at bottom/top of web page?
(10 answers)
Closed 7 years ago.
Hi can any body help me....why css file include in header section but js file in the last of the page. can i also include the css file in bottom of the file.
<!DOCTYPE html>
<html>
<head>
<link type="text/css" href="myFolder/style.css" rel="stylesheet">
</link>
</head>
<body>
<div>
<p>Paragraph 1 in the div.</p>
<p>Paragraph 2 in the div.</p>
</div>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
</html>
When a browser encountered a tag pointing to an external resource, the browser would stop parsing the HTML, retrieve the script, execute it, then continue parsing the HTML. In contrast, if the browser encountered a for an external stylesheet, it would continue parsing the HTML while it fetched the CSS file (in parallel).
The purpose of the "put stylesheets at the top and scripts at the bottom" rule is that, in general, it's the best way to achieve optimal progressive rendering, which is critical to the user experience.
Hence, the widely-repeated advice to put stylesheets first – they would download first, and the first script to download could be loaded in parallel.
However, modern browsers (including all of the browsers I tested with above) have implemented speculative parsing, where the browser "looks ahead" in the HTML and begins downloading resources before scripts download and execute.
For detail info refer this link :
Css before Js

CSS Stylings Tips

I have a web page that is was optimized mostly for IE and Chrome. I am trying to figure out tips on how I should display this image since it looks quite awful just sitting above the copyright on all my webpages. I am looking for any CSS tips on how I can make the highlighted portion of this web page have a more professional look to it. All suggestion are greatly appreciated!
<p class="clearfix">
This page is optimized for Internet Explorer and Chrome. To ensure accurate processing of your mail packet, please ensure JavaScript is enabled in your browser.
</p>
What I suggest doing is center the copyright info. Then create two separate CSS files. One that will be used if the user doesn't have javascript enabled and the other if they do. The text you have ("This page is optimized for..") should be in the CSS file where javascript is disabled(Also move that text to the top of the page and center it).
How do you check to see if they have javascript enabled? do this
<link rel="stylesheet" href="jsdisabled.css" />
<script type="text/javascript">
document.write('<link rel="stylesheet" href="jsenabled.css" />');
</script>
"although the solution below works it does not validate
inside your noscript tag you can put some style tag that hides the rest of your content. "
*no script option *
<noscript>
<style type="text/css">
#content { display:none; }
</style>
no js content goes here.
</noscript>
How can I show different content when JavaScript is disabled?
This way that text won't appear for everyone, just the people who don't have javascript enabled.

IE11 will not load external css from intranet

IE11 will NOT load external css from the intranet - at all. Internal css works fine. In-line css works fine. External CSS works fine on the Internet. Everything works fine in other browsers - everywhere!
When I open C:\Users\hennesse\Desktop\test.html (below) by either right-clicking and openWith->IE - or- typing into the IE location bar, I get two alerts: "internal javascript", and "external javascript" - then:
the first line is NOT red
the second line is blue
the third line is green
However, if I upload this to my web server, and open it with IE, the first line IS red. With Firefox and Chrome, the first line is ALWAYS red, intranet or internet.
For some reason, IE11 will not load the external CSS file on "My Computer".
Changing security settings in Internet Options->Security->Allow Active Content to run in My Computer (and rebooting) results in a prompt (or not) about Allow Active Content? But the results are the same.
This is driving me insane! -Dave
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Test Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="test.css">
<!--
external file test.css contains:
body { color: #ff0000 }
-->
<style type="text/css">
.blue {
color: blue;
}
</style>
<script type="text/javascript">
alert("internal javascript");
</script>
<script type="text/javascript" src="test.js">
// external file test.js contains
// alert("external javascript");
</script>
</head>
<body>
This should be red, but it isn't
<p class="blue">
This is blue
</p>
<p style="color:green">
This is green
</p>
</body>
</html>
In the F12 console, I found: SEC7113 "CSS was ignored due to mime type mismatch". Discussion here: 1 [MSDN]. It seems that IE9 and above "sniff" the HTTP headers for the correct MIME type, and ignore JS and CSS that have the wrong header. When it fetches files from the local filesystem, it should disable this sniffing, since there aren't any real HTTP headers.
But my particular computer is sniffing and ignoring anyway. I've searched and searched, but the mighty Internet has only yielded one other person who has this problem. She solved it by reloading the operating system. I'm not gonna do that!
I very seldom use IE for anything except a final compatibility check after I've loaded stuff to a server. Except for one personal "extension" to a Windows app that invokes IE on the user's computer. Since I'm the only using it, I just hit F12, and select IE8 mode (this shows it's the IE9-up MIME sniffing). It works fine, and since it only costs me a couple mouse clicks, it sure beats reloading the OS.
Although I didn't really solve the problem, perhaps the "sniff and ignore" info can help someone else do so. OCHI - thanks for your help.
-Dave

CSS disappears when I add a doctype [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
When I add a doctype to my site, my CSS fails to load. It works fine when there is no doctype.
This is my doctype:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
My CSS location is here:
www.site.com/static/css/main.css
Defined like this:
<link href="/static/css/main.css" rel="stylesheet" type="text/css" />
I did some googling, but my site pretty much validates, so I cant understand why the entire CSS would refuse to show completely!
Here is a URL: LIVE SITE
I am using latest Google Chrome
[21:51:53.698] The stylesheet /static/css/main.css was not loaded
because its MIME type, "text/plain", is not "text/css".
You need to make sure the mime type is text/css.

IE conditional comment not working [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 11 years ago.
I'm having a bit of a problem with the conditional comment for IE.
<link rel = "stylesheet"
type = "text/css"
href = "css/stil.css" />
<!--[if IE]>
<link rel = "stylesheet"
type = "text/css"
href = "css/ie.css" />
<![endif]-->
It's not working in IE9, IE9 loads the normal stylesheet (css/stil.css) and not the one i specify in the conditional comment. Please help :)
IE9 loads the normal stylesheet (css/stil.css) and not the one i specify in the conditional comment.
From that sentence, it sounds like you're not expecting IE to download and apply the css/stil.css stylesheet. It should and will. It's just that it should also download and apply the css/ie.css stylesheet. Could it be that you're seeing styles from css/stil.css that you aren't expecting? On the face of it, the conditional comments work fine (I had to use style rather than link elements in that example, but the concept is the same).

Resources