• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ReferenceError: getAreaNameDropDownJS is not defined

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

When i click Update Area updateArea.jsp page will be shown in view2

areaTab.jsp




updateArea.jsp

In this page i am calling getAreaNameDropDownJS function.



calling from the
updateArea.jsp


while calling this function from updateArea.jsp page on firebug gives me ReferenceError: getAreaNameDropDownJS is not defined error.
I confused why this ReferenceError is came. Also i included required jquery js files.
Please suggest what happening with code..

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

is not required inside getAreaNameDropDownJS. See if that helps. See use of $(document).ready here.
 
Suraj Savaratkar
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Even i write


still on firebug console does not any prints ..! How it can possible simple ready! also not printed.
What is the reason can you find any problem??
 
K Bspring
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make sure all your javascript code is between script tag.

 
Suraj Savaratkar
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
It works fine in separate Dynamic web project. But in project in updateArea.jsp does not work. How its happening.. Any idea please..
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are clearly using jQuery, you should not be using onclick anywhere on the page. Use jQuery event functions to establish event handlers.

And yes, your usage of the ready function is incorrect -- it encloses code to be executed when the document is ready and should never be inside another function.
 
Suraj Savaratkar
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am new in JQuery. Whats is exact mean of mean document is ready. Is $( document ).ready(function() {}); call after page is called or load ?? I quite confuse about document.ready.
I also wrote



Is this ready function when calls??
Can we call javascript event handler by calling JQuery functions inside javascript function by method name inside onclick, onblur, onchange??
If we can then which jQuery event should be used?
If no then what is the alternate for this??
Please help/suggest...
 
K Bspring
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all place all your javascript code within script tags.
w3schools.com/jquery has good simple examples for learning jQuery
 
Bear Bibeault
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
w3schools is not generally regarded well as a resource. There are plenty of other places to see jQuery examples. And of course, I'm going to recommend jQuery in Action, 3rd Edition.
 
Suraj Savaratkar
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thanks for reply..

I had change the execution flow of jsp pages and added


and write jQuery function in external js file. All areaNames automatically fetched from database ondocument.ready and append the option to existing select tag. It appears all areaNames in my select dropdown list. As you told i removed the onclick function call and it works fine.


Thank you,Thank you,Thank you .. For helping and guidelines..
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic