![]() |
|
Calling my function? - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Coders Lounge (https://hackforums.net/forumdisplay.php?fid=5) +---- Thread: Calling my function? (/showthread.php?tid=3540675) |
Calling my function? - Jordy Clasie - Jun 10, 2013 Hey guy's so i created a function call nameString, with the parameter placeholder called (name) When i put my own name in the parameter it give me the following error ReferenceError: kevin is not defined, but i define the parameter when i am calling the function. Code var nameString = function (name) {Could anyone please help me out, i am a JS beginner but i am still getting more the hang of it. * - ๖ۣۜAlexander - Jun 10, 2013 Try calling the function like this: Code nameString(keven)Not sure with or without ", been a long time since I used JS. * - Jordy Clasie - Jun 10, 2013 (Jun 10, 2013 10:07 AM)AnonGenReleases Wrote: Try calling the function like this: Thank's got it already and it is without the quotation marks. * - Mafugsa Bob - Jun 10, 2013 Wrong section. Web Development @Anon nameString("Keven"); is correct. @OP nameString = "Kevin"; should fix it. Otherwise it's looking for a variable called "Kevin" PHP Code Works PHP Code Does not work. You'd get an error like: "ReferenceError: kevin is not defined". |