-
Notifications
You must be signed in to change notification settings - Fork 513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't 'include' within <head> tags. #176
Comments
hmm do you have a snippet that we can reproduce with? there shouldn't be anything content-specific like head tags etc, ejs doesn't care about any of that |
Wow! Thank you VERY much for replying so incredibly quickly! That is also great news that the error is mine. Since the error is almost certainly mine, I do NOT expect anyone here to assist me. However, if anyone feels generous, here is my app.js: /**
* Module dependencies.
*/
var express = require('express');
var routes = require('./routes');
var user = require('./routes/user');
var http = require('http');
var path = require('path');
var ejs = require('ejs');
var app = express();
// all environments
app.set('port', process.env.PORT || 9977);
app.engine('html', ejs.renderFile);
app.set('view engine', 'html');
app.set('views', path.join(__dirname, 'views'));
app.use(express.favicon(path.join(__dirname, 'public/images/all.ico')));
app.use(express.logger('dev'));
app.use(express.json());
app.use(express.urlencoded());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));
ejs.open = '{{';
ejs.close = '}}';
// development only
if ('development' == app.get('env')) {
app.use(express.errorHandler());
}
app.get('/', routes.index);
app.get('/about', routes.about);
http.createServer(app).listen(app.get('port'), function(){
}); And here is my routes/index.js: /*
* GET home page.
*/
exports.index = function(req, res){
res.render('index');
}; Please let me know if there is anymore information I can provide. Thanks Again! |
Is that the actual text output? Or is that what appears in the chrome web-inspector. Often the result of doing a right click then "View Page Source" will give a very different result from the chrome debugger. This happens any time you output html that isn't "valid" as the browsers attempt to compensate and often that means moving elements around in really surprising ways. |
Also, what's the contents of commonHead.html |
@robotogre Can you answer @ForbesLindesay's two questions? I really want to fix this, so if you are still here please give us enough information to reproduce this bug. |
Hello! I have searched my computer, but I am unable to find the affected code project files. :( I would assume that the problem was almost certainly my fault, as I am a total novice with node.js and JavaScript templating engines. I am extremely impressed with your intent to help! |
If I do the following within index.html:
The rendered version of index.html that is served appears as:
Two things are wrong:
How can I 'include' text inside the 'head' tags? :(
The text was updated successfully, but these errors were encountered: