It's not a secret anymore!*
The moose likes HTML, CSS and JavaScript and the fly likes my jquery script is not executing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "my jquery script is not executing" Watch "my jquery script is not executing" New topic
Author

my jquery script is not executing

Jagdeep Sharma
Ranch Hand

Joined: May 24, 2010
Posts: 121

Guys below is my code of external title.js and main file. But it is not working. Please tell me where is the problem.



Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61457
    
  67

The problem is that you haven't told us what the problem is.

Please read ItDoesntWorkIsUseless.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jagdeep Sharma
Ranch Hand

Joined: May 24, 2010
Posts: 121

Bear Bibeault wrote:The problem is that you haven't told us what the problem is.

Please read ItDoesntWorkIsUseless.


I am sorry Bear. Problem is when i use external js file's method inside ready method, all things work fine. But when i use this in external js file, method is not invoked on click event.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61457
    
  67

You are establishing your click event before the DOM is created. That won't work. You need to put that code in a ready handler.
Jagdeep Sharma
Ranch Hand

Joined: May 24, 2010
Posts: 121

Bear Bibeault wrote:You are establishing your click event before the DOM is created. That won't work. You need to put that code in a ready handler.




How can i do it. I want to use click handler in multiple places.



Can i use ready method in external js file.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61457
    
  67

You've already demonstrated that you know how to establish a ready handler, and yes, ready handlers can be established in external JavaScript files.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: my jquery script is not executing