Click here to Skip to main content
16,017,502 members
Home / Discussions / JavaScript
   

JavaScript

 
QuestionJs question Pin
Member 1499144112-Nov-20 10:28
Member 1499144112-Nov-20 10:28 
QuestionRe: Js question Pin
Richard MacCutchan12-Nov-20 21:44
mveRichard MacCutchan12-Nov-20 21:44 
Questiontoo many scripts? Pin
Member 1469595610-Nov-20 22:18
Member 1469595610-Nov-20 22:18 
AnswerRe: too many scripts? Pin
Richard Deeming10-Nov-20 22:42
mveRichard Deeming10-Nov-20 22:42 
GeneralRe: too many scripts? Pin
Member 1469595610-Nov-20 23:37
Member 1469595610-Nov-20 23:37 
AnswerRe: too many scripts? Pin
Sandeep Mewara10-Nov-20 22:46
mveSandeep Mewara10-Nov-20 22:46 
GeneralRe: too many scripts? Pin
Member 1469595610-Nov-20 23:35
Member 1469595610-Nov-20 23:35 
Question[Vanilla Javascript Newbie] How to access a function of a function from a part of code oustide this function Pin
GlowWurm19778-Nov-20 10:03
GlowWurm19778-Nov-20 10:03 
Hi,

I am almost new with javascript.

I finally succeeded to write the foundation of a small javascript game but I am blocked at one point.

My question is simple: how can I call the function quitGame() from outside the Game() function?

[code]
var settings = "blablah";

new Game(settings);

...

quitGame(settings) // ERROR: "Uncaught TypeError: quitGame is not a function at HTMLDocument.<anonymous>"

var Game = function(settings) {

... 

    function quitGame(settings) {

        ...
         
    }

}
[/code]


I would be thankful for any help or comment about my code.

I wish you a pleasant lockdown, stay safe Smile | :)
AnswerRe: [Vanilla Javascript Newbie] How to access a function of a function from a part of code oustide this function Pin
Richard MacCutchan8-Nov-20 21:58
mveRichard MacCutchan8-Nov-20 21:58 
AnswerRe: [Vanilla Javascript Newbie] How to access a function of a function from a part of code oustide this function Pin
Richard Deeming9-Nov-20 22:07
mveRichard Deeming9-Nov-20 22:07 
QuestionGet image extension Pin
Valentinor4-Nov-20 3:10
Valentinor4-Nov-20 3:10 
AnswerRe: Get image extension Pin
Blanksy8-Nov-20 11:12
Blanksy8-Nov-20 11:12 
GeneralRe: Get image extension Pin
Valentinor8-Nov-20 19:33
Valentinor8-Nov-20 19:33 
GeneralRe: Get image extension Pin
Richard Deeming8-Nov-20 21:53
mveRichard Deeming8-Nov-20 21:53 
GeneralRe: Get image extension Pin
Valentinor9-Nov-20 5:43
Valentinor9-Nov-20 5:43 
GeneralRe: Get image extension Pin
Richard Deeming9-Nov-20 5:58
mveRichard Deeming9-Nov-20 5:58 
GeneralRe: Get image extension Pin
Valentinor9-Nov-20 10:31
Valentinor9-Nov-20 10:31 
GeneralRe: Get image extension Pin
Richard Deeming9-Nov-20 21:36
mveRichard Deeming9-Nov-20 21:36 
GeneralRe: Get image extension Pin
Valentinor10-Nov-20 4:10
Valentinor10-Nov-20 4:10 
Questionfunction with OR Pin
Member 1497891029-Oct-20 9:30
Member 1497891029-Oct-20 9:30 
AnswerRe: function with OR Pin
Richard MacCutchan29-Oct-20 10:41
mveRichard MacCutchan29-Oct-20 10:41 
SuggestionJSMAN - JavaScript Map alternative notation Pin
Member 1497706227-Oct-20 17:35
Member 1497706227-Oct-20 17:35 
GeneralRe: JSMAN - JavaScript Map alternative notation Pin
Sandeep Mewara27-Oct-20 19:34
mveSandeep Mewara27-Oct-20 19:34 
Questionfind low distance from two matrices Pin
costy3527-Oct-20 6:57
costy3527-Oct-20 6:57 
GeneralRe: find low distance from two matrices Pin
Richard MacCutchan27-Oct-20 7:14
mveRichard MacCutchan27-Oct-20 7:14 

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.