Click here to Skip to main content
15,905,232 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Help me to write a small program. Pin
Richard MacCutchan26-Apr-16 20:44
mveRichard MacCutchan26-Apr-16 20:44 
QuestionThanks Richard Deeming & RyanDev Pin
tayfunk63 NevCity25-Apr-16 12:22
tayfunk63 NevCity25-Apr-16 12:22 
SuggestionRe: Thanks Richard Deeming & RyanDev Pin
Richard MacCutchan25-Apr-16 21:51
mveRichard MacCutchan25-Apr-16 21:51 
GeneralRe: Thanks Richard Deeming & RyanDev Pin
tayfunk63 NevCity26-Apr-16 2:49
tayfunk63 NevCity26-Apr-16 2:49 
AnswerRe: Thanks Richard Deeming & RyanDev Pin
ZurdoDev26-Apr-16 3:23
professionalZurdoDev26-Apr-16 3:23 
QuestionHalf Chart turned into a black box plotted using d3.js java script library Pin
KittoKy25-Apr-16 6:48
KittoKy25-Apr-16 6:48 
AnswerRe: Half Chart turned into a black box plotted using d3.js java script library Pin
Richard Deeming26-Apr-16 1:43
mveRichard Deeming26-Apr-16 1:43 
Questionjavascript Pin
Member 1215513524-Apr-16 22:45
Member 1215513524-Apr-16 22:45 
QuestionRe: javascript Pin
ZurdoDev25-Apr-16 1:38
professionalZurdoDev25-Apr-16 1:38 
Questionhelp me to make a small program Pin
Mohammad Billal Hossain16-Apr-16 0:24
Mohammad Billal Hossain16-Apr-16 0:24 
AnswerRe: help me to make a small program Pin
Richard MacCutchan16-Apr-16 0:50
mveRichard MacCutchan16-Apr-16 0:50 
GeneralRe: help me to make a small program Pin
Mohammad Billal Hossain16-Apr-16 1:14
Mohammad Billal Hossain16-Apr-16 1:14 
GeneralRe: help me to make a small program Pin
Richard MacCutchan16-Apr-16 1:51
mveRichard MacCutchan16-Apr-16 1:51 
AnswerRe: help me to make a small program Pin
Peter Leow16-Apr-16 0:57
professionalPeter Leow16-Apr-16 0:57 
GeneralRe: help me to make a small program Pin
Mohammad Billal Hossain16-Apr-16 1:16
Mohammad Billal Hossain16-Apr-16 1:16 
QuestionRe: help me to make a small program Pin
ZurdoDev25-Apr-16 1:39
professionalZurdoDev25-Apr-16 1:39 
QuestionJquery in MVC 4.0 adding templates Pin
Member 1241562115-Apr-16 1:54
Member 1241562115-Apr-16 1:54 
RantREPOST Pin
Richard Deeming15-Apr-16 1:56
mveRichard Deeming15-Apr-16 1:56 
PraiseRe: REPOST Pin
John C Rayan15-Apr-16 4:48
professionalJohn C Rayan15-Apr-16 4:48 
QuestionEXT JS 2.2 - File upload control Pin
Hemant Thaker13-Apr-16 3:39
Hemant Thaker13-Apr-16 3:39 
QuestionHow to hide "save as" button in IE11 Pin
vivek rajavel11-Apr-16 20:18
vivek rajavel11-Apr-16 20:18 
AnswerRe: How to hide "save as" button in IE11 Pin
John C Rayan15-Apr-16 3:44
professionalJohn C Rayan15-Apr-16 3:44 
GeneralISBT Barcode Pin
Praveen Kandari10-Apr-16 20:28
Praveen Kandari10-Apr-16 20:28 
GeneralRe: ISBT Barcode Pin
Richard MacCutchan10-Apr-16 20:50
mveRichard MacCutchan10-Apr-16 20:50 
QuestionOdd TypeError being thrown. Pin
Dralken5-Apr-16 9:57
Dralken5-Apr-16 9:57 
Working on a website in Node.JS, and I've been doing good so far, but I've hit an error that has me stumped.

TypeError: Cannot set property 'isSubmitted' of undefined
   at app.post.res.locals.showform (/media/sf_Node.js/SmartCage2/user.js:76:25)
   at Layer.handle [as handle_request] (/media/sf_Node.js/SmartCage2/node_modules/express/lib/router/layer.js:95:5)
   at next (/media/sf_Node.js/SmartCage2/node_modules/express/lib/router/route.js:131:13)
   at Route.dispatch (/media/sf_Node.js/SmartCage2/node_modules/express/lib/router/route.js:112:3)
   at Layer.handle [as handle_request] (/media/sf_Node.js/SmartCage2/node_modules/express/lib/router/layer.js:95:5)
   at /media/sf_Node.js/SmartCage2/node_modules/express/lib/router/index.js:277:22
   at Function.process_params (/media/sf_Node.js/SmartCage2/node_modules/express/lib/router/index.js:330:12)
   at next (/media/sf_Node.js/SmartCage2/node_modules/express/lib/router/index.js:271:10)
   at jsonParser (/media/sf_Node.js/SmartCage2/node_modules/body-parser/lib/types/json.js:100:40)
   at Layer.handle [as handle_request] (/media/sf_Node.js/SmartCage2/node_modules/express/lib/router/layer.js:95:5)

The section that's throwing the error:
JavaScript
app.get('/login', function (res, req) {
	res.locals.isSubmitted = false;
	res.render("user/login.html");
});


The odd thing is, I use the same code above this, and it works.
JavaScript
app.get('/register', function(req,res) {
	res.locals.isPosted = false;
	res.render("user/register.html");
});


I have the forms submitted to the corresponding page (/login to /login, /register to /register), and I use the Nunjucks template system to show relevant data depending on how whether it was accessed via GET or POST.

I have no idea why it would be throwing the error on one section, but not the other.

I do, however, want to note that I barely know Javascript. I've always used strongly typed languages. I don't even like using 'var' in C#.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.