noob question, i start create handlebars templates and is kind useful.
I can create templates without load a html tag in html file, so should I just use handlebars and stop use html tags in my html? what you recommend guys? its a good practice or no? thank you.
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang=""> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<link href='http://fonts.googleapis.com/css?family=Nunito:400,700,300' rel='stylesheet' type='text/css'>
<!-- <link rel="stylesheet" href="public/stylesheets/style.css"> -->
<style>
body {
padding-top: 50px;
padding-bottom: 20px;
}
</style>
</head>
<body class="body">
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please upgrade your browser to improve your experience.</p>
<![endif]-->
<script src="public/javascripts/libs/jquery-2.1.4.min.js"></script>
<script src="public/javascripts/libs/handlebars-v3.0.3.js"></script>
<script src="public/javascripts/index-template.js"></script>
<script src="public/javascripts/templates/h1-h2.js"></script>
</body>
</html>
Related
I'm trying to setup a backbone application, and I get a "$ is not defined" error.
Tree :
app :/
app.js
js :/
jquery.js
underscore.js
backbone.js
I have a config.coffee file for brunch :
exports.config = paths:
public: 'www' files:
javascripts:
joinTo:
'js/atf.js': /^app/
order:
before: [
'app/js/jquery-2.0.2.min.js',
'app/js/underscore.js',
'app/js/backbone.js'
]
stylesheets:
joinTo:
'css/atf.css': /^app/
templates:
joinTo: 'js/atf.js'
My index.html file :
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="fr"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="fr"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="fr"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="fr" x-manifest="/manifest.appcache"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="stylesheet" type="text/css" media="all" href="/css/atf.css?v=2">
<script src="/socket.io/socket.io.js"></script>
<script src="/js/atf.js?v=3"></script>
<script>require('app');</script>
</head>
<body></body>
</html>
And my app.js file just to make a test :
$(function(){
alert('test');
});
Anyone can help me ? Thanks !
Move files from app/js to vendor (create this directory). And change javascripts.joinTo to the same one you are using in templates.
That should do the trick.
I'm editing someone elses webpage for content, by changing the HTML files on the drive, adding text, comments, wtv. I'm not a web designer, so this is the only way I knew to do it.
On most browsers, my changes show, but on internet explorer, sometimes it will revert to the old webpage. I can't find the info for the old page anywhere on the drive that holds all of this content. Please steer me in the right direction.
If it helps, each page starts like this (this part I haven't edited)
<!DOCTYPE html>
<!--[if lt IE 7]> <html lang="en-us" class="no-js ie6"> <![endif]-->
<!--[if IE 7]> <html lang="en-us" class="no-js ie7"> <![endif]-->
<!--[if IE 8]> <html lang="en-us" class="no-js ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en-us" class="no-js ie9"> <![endif]-->
<!--[if gt IE 9]><!--> <html lang="en-us" class="no-js"> <!--<![endif] -->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>This Particular Pages Title</title>
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="fontawesome/css/font-awesome.min.css" >
<link href="style/less/main.css" rel="stylesheet" type="text/css">
<!-- Custom CSS -->
<link href="css/business-custom.css" rel="stylesheet">
<script src="jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script><script src="selectivizr-min.js"></script>
<![endif]-->
I think IE uses caching.
By adding a random parameter to the URL the caching will be circumvented.
so e.g. www.mysite.nl?1
and then
www.mysite.nl?2
etc.
I'm facing a prob with my CSS in IE7 and IE6. The biggest problem is that in one of my page the CSS is not loading at all in IE 7,6.
When I use the following code-
<!DOCTYPE html>
[if lt IE 7] <html class="lt-ie9 lt-ie8 lt-ie7" lang="en"> [endif]
[if IE 7] <html class="lt-ie9 lt-ie8" lang="en"> [endif]
[if IE 8] <html class="lt-ie9" lang="en"> [endif]
[if IE 9] <html class="ie9" lang="en"> [endif]
[if gt IE 9] <html lang="en"> [endif]
The CSS is getting loaded, but then, while running the website on chrome or Firefox the above codes of line are also printed. However no line is printed while using IE and the CSS is working fine.
Also when I use this code
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="lt-ie9" lang="en"> <![endif]-->
<!--[if IE 9]> <html class="ie9" lang="en"> <![endif]-->
<!--[if gt IE 9]><!--> <html lang="en"> <!--<![endif]-->
The CSS does not loads again in IE. What should I do.?
I hope my question is clear to you. Please Help.
You file starts with this:
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
function test(add)
{
var pin;
if(window.XMLHttpRequest)
{
pin=new XMLHttpRequest();
}
else
{
pin= new ActiveXobject("Microsoft.XMLHTTP");
}
url=add;
pin.open("GET",url,true);
pin.send();
}
</script>
</head>
</html><!DOCTYPE html>
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="lt-ie9" lang="en"> <![endif]-->
<!--[if IE 9]> <html class="ie9" lang="en"> <![endif]-->
<!--[if gt IE 9]><!-->
<html lang="en">
…
As you are ending the file before it even starts, you are triggering quirks mode in IE7 and below. Your file should start like the 2nd snippet you've posted.
I'm developing a Grails project which is using some JS code. It runs perfectly in Google Chrome (v34.0.1847.116 m) and Mozilla Firefox (v28.0), but it simply does not run/start in IE (v9.0.23). I just have a blank screen.
According to many previous answers on SO community, I should be checking some meta tags which I'm using, but it's not running successfully anyway. There goes my code!
page.gsp, used as main layout:
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html class="win firefox firefox2 gecko gecko2" lang="br">
<!--[endif]-->
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
<title><g:layoutTitle default="A nice Title"/></title>
<r:require modules='core'/>
<g:layoutHead />
<r:layoutResources />
</head>
<body>
<div id="container">
<div id="header">bla bla bla<g:navbar /></div>
<g:menu menuKey="1"/> <!-- a taglib which builds a dynamic menu -->
<div id="content">
<g:layoutBody />
</div>
</div>
<div id="footer"><div class="container">bla bla bla</div></div>
<r:layoutResources/>
</body>
</html>
home.gsp, a simple view to be loaded in the layout above.
<html>
<head>
<meta name="layout" content="page" />
</head>
<body>
<h2>A simple content here</h2>
</body>
</html>
I'm loading all my JS and CSS resources using ApplicationResources.groovy but I don't have any JS error according my Firebug. After all, what else could I check or what features/functions' success must I asure?
Change
<!--[if (gt IE 9)|!(IE)]><!-->
<html class="win firefox firefox2 gecko gecko2" lang="br">
<!--[endif]-->
to (properly close the else comment)
<!--[if (gt IE 9)|!(IE)]><!-->
<html class="win firefox firefox2 gecko gecko2" lang="br">
<![endif]-->
I am not able to render AngularJs templates in Internet Explorer 8, I have followed several suggestions for using AngularJs in Internet Explorer but I am still not able to get it to work. below is my html code for the page including the scripts I have used. Is it possible to point out if I am using anything that could make the code not work in Internet Explorer? I can upload details of other files if anybody would like to know the details of it. Everything works perfectly on all other browsers but just Internet Explorer.
<!doctype html>
<!--[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 xmlns:ng="http://angularjs.org" id="ng-app" ng-app="tripApp" class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<!-- build:css({.tmp,app}) styles/main.css -->
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
<link rel="stylesheet" href="styles/main.css">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,400,300,600,700' rel='stylesheet' type='text/css'>
<style>
#-moz-document url-prefix() {
.filter-menu .btn {
padding: 0;
}
}
</style>
<!-- endbuild -->
<script src="bower_components/modernizr/modernizr.js"></script>
<!--[if lte IE 8]> <script src="scripts/angular-ui-ieshiv.js"></script><![endif]-->
<!--[if lte IE 8]>
<script>
document.createElement('ng-include');
document.createElement('ng-pluralize');
document.createElement('ng-view');
// Optionally these for CSS
document.createElement('ng:include');
document.createElement('ng:pluralize');
document.createElement('ng:view');
</script>
<![endif]-->
<!--[if lt IE 7]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE7.js"></script>
<![endif]-->
<!--[if lt IE 8]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE8.js"></script>
<![endif]-->
<!--[if lt IE 9]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script>
<![endif]-->
<!-- <script src="bower_components/less/dist/less-1.4.2.min.js"></script> -->
</head>
<body>
<!--[if lt IE 8]>
<p class="chromeframe">You are using an outdated browser. Upgrade your browser today or install Google Chrome Frame to better experience this site.</p>
<![endif]-->
<!--[if lt IE 9]>
<script src="bower_components/es5-shim/es5-shim.js"></script>
<script src="bower_components/json3/lib/json3.min.js"></script>
<![endif]-->
<!-- Add your site or application content here -->
<aside id="sidebar">
<ul class="list-unstyled">
<li></span></li>
<li></span></li>
<li></span></li>
</ul>
</aside>
<section id="topbar">
<ul class="list-unstyled">
<li><span class="icon-briefcase icon-2x"></span></li>
</ul>
</section>
<section id="main-container">
<section ui-view id="main-inner-container"></section>
</section>
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
<script>
var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src='//www.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="bower_components/jquery-easing/jquery.easing.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js"></script>
<script src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.5.0.js"></script>
<script src="bower_components/angular-ui-router/release/angular-ui-router.min.js"></script>
<script src="http://code.angularjs.org/1.0.3/angular-resource.min.js"></script>
<script src="bower_components/angular-animate/angular-animate.min.js"></script>
<script src="bower_components/angular-promise-tracker/promise-tracker.min.js"></script>
<script src="scripts/app.js"></script>
<script src="scripts/services.js"></script>
<script src="scripts/directives.js"></script>
<script src="scripts/controllers/hotelsController.js"></script>
<script src="scripts/controllers/restaurantsController.js"></script>
<script src="bower_components/masonry/masonry.js"></script>
<!-- build:js({.tmp,app}) scripts/scripts.js -->
<!-- endbuild -->
</body>
</html>
I am working on AngularJS project at the moment where Internet Explorer 8 support is required.
Everything is working fine cross browsers - including IE 8.
If you need to give IE8 support my first advice for you is to not use custom element tags such as <mynewtag> (use the attribute version <div mynewtag> instead).
It will save you the headache of creating elements on the fly like this one:
<!--[if lte IE 8]><script> document.createElement('mynewtag');</script><![endif]-->
Below you can find my index.html bootstrapped for AngularJS to work with IE 8:
<!DOCTYPE html>
<!--[if IE 8]>
<html class="no-js lt-ie9" xmlns:ng="http://angularjs.org" id="ng-app" ng-app="myApp">
<![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" ng-app="myApp">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title ng-bind="header"></title>
<meta name="description" content="">
<!-- build:css({.tmp,app}) system/css/main.css -->
<link rel="stylesheet" href="system/css/main.css">
<!-- endbuild -->
<!--[if IE 8]>
<script src="ui/components/es5-shim/es5-shim.js"></script>
<script src="ui/components/json3/lib/json3.min.js"></script>
<![endif]-->
</head>
<body ng-controller="myAppCtrl">
<!-- Add site or application content here -->
<div class="content" ng-view=""></div>
<!-- build:js system/js/plugins.js -->
<script src="ui/components/angular/angular.js"></script>
<!-- endbuild -->
<!-- build:js({.tmp,app}) system/js/scripts.js -->
<script src="system/js/app.js"></script>
<script src="system/js/filters/filters.js"></script>
<script src="system/js/controllers/controllers.js"></script>
<script src="system/js/services/services.js"></script>
<script src="system/js/directives/directives.js"></script>
<script src="system/js/scripts.js"></script>
<!-- endbuild -->
<!-- build:js system/js/modules.js -->
<script src="ui/components/angular-resource/angular-resource.js"></script>
<script src="ui/components/angular-cookies/angular-cookies.js"></script>
<script src="ui/components/angular-sanitize/angular-sanitize.js"></script>
<!-- endbuild -->
</body>
</html>
Hope that's helpful.