Page 1 of 1

Coding Problem Using Script

Posted: Wed Dec 11, 2013 2:05 pm
by emma h

What is wrong with this coding:
Script Mad Lib: ReferenceError: noun1 is not defined ( @ 19 : 68 ) - cles as well as " + verb + " . This increases that rate of your " + noun1 + "

Here is my entire coding:

// get name from service, name is entered in the app
var adjective = request.get("verbing");
var vegetable = request.get("adjective");
var verb = request.get("noun");
var adjective2 = request.get("verb");
var vegetable = request.get("noun1");

var verbing = request.get("noun2");
var verbing1 = request.get("animal");
var noun = request.get("noun3");

var adjective3 = request.get("verb1");
var number = request.get("adjective1");
var verb2 = request.get("color");

// put together the mad lib string
var greetingString = " Most doctors agree that bicyle " + verbing + " is a" + adjective + " form of excerise. Using a bicyle enables you to develop your " + noun + " musc cles as well as " + verb + " . This increases that rate of your " + noun1 + " beat. More " + noun2 + " drive " + animal + ". No matter what kind of " + noun3 + " you " + verb1 + ", always be sure to wear a " + adjective1 + " helmet. Make sure to have " + color + " reflectors too! ";

// format as JSON and return the response
response.success(JSON.stringify({
greeting: greetingString
}), "application/json");


Coding Problem Using Script

Posted: Wed Dec 11, 2013 2:09 pm
by Maryna Brodina

Hello! Could you provide more details? Where are you running this code and what are you trying to achieve?


Coding Problem Using Script

Posted: Thu Dec 12, 2013 2:21 pm
by emma h

i am running this code out of a mad lib script i created under the server code tab. I am trying to make an app where when you type a word into an input it will appear in a paragraph i had previously created.


Coding Problem Using Script

Posted: Thu Dec 12, 2013 2:28 pm
by emma h

i am actually all set thank you!


Coding Problem Using Script

Posted: Thu Dec 12, 2013 2:31 pm
by Kateryna Grynko

Emma,

Thank you for the update! Are there any other issues?