here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more javascript function is not defined about Stack Overflow the company Business Learn more about hiring developers or posting
Uncaught Referenceerror Function Is Not Defined
ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack
Uncaught Referenceerror: $ Is Not Defined
Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Console function not defined error? up vote 0 down vote favorite I do not understand why my function isn't working and why I keep getting a "test is not defined error" when I try to run it. I want the page to scroll down to the appropriate section, when the user clicks the right menu item.
Event5 some text some text some text Javascript function: function test(postLocation){ var post = $('#post'+postLocation).offset(); $(window).scrollTop(post.top); }; I originally wanted to make the list item itself start the function, but I guess it has to be a button? javascript jquery css share|improve this question edited Jan 8 '14 at 6:14 asked Jan 8 '14 at 5:35 user2559519 rename test to findPost or findPost to test() –Raunak Kathuria Jan 8 '14 at 5:38 Sorry! test is defined in the javascript. I changed the name from findPost to test...but even with test() (changed it above) I get/got the same problem. –user2559519 Jan 8 '14 at 5:43 You are not passing postLocation right? –Roy M J Jan 8 '14 at 6:09 Another mistake from fumbling around. I've updated the code to make it clearer what I'm trying to do. Users suggest adding the onClick event in the javascript, but is there another way? I'd hate to have to update both the html and javascript every time I add a new post/menu item. It would be nice to just add a new article and list item and give the ar
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it http://stackoverflow.com/questions/20987770/console-function-not-defined-error only takes a minute: Sign up Why am I seeing 'function not defined' on my error console when I'm sure my function IS defined? up vote 1 down vote favorite The code I'm using is supposed to change the 'action' attribute for a form based on radio button selection. It doesn't work at the moment and I'm trying to work out http://stackoverflow.com/questions/8943953/why-am-i-seeing-function-not-defined-on-my-error-console-when-im-sure-my-func why. According to my Firefox error console, the function 'submitForm' is not defined - but I'm sure it is defined!! Can anyone help? Code as follows: Inside the head (q1 refers to the name attribute of the radio buttons): And the event handler: