This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes jQuery not working on page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "jQuery not working on page" Watch "jQuery not working on page" New topic
Author

jQuery not working on page

Aniruddh Joshi
Ranch Hand

Joined: Jul 29, 2008
Posts: 275

Hi

I have a code which generates HTML.
I am trying to use jQuery in this but it is not working.



the HTML generated follows :





I get JS error inside
document.ready
when I try to call a selector
I am really new to jQuery and can't find what the issue might be. Please look into the html and see if a help is possible.


Anrd
"One of the best things you could do is to simplify a larger application into a smaller one by reducing its process and complexity - Fowler"
Sean Clark
Rancher

Joined: Jul 15, 2009
Posts: 377

Hey,

What is the error message that you are getting?
Also what are you expecting to happen? You don't have any html elements that have a class called text.

Sean


I love this place!
Aniruddh Joshi
Ranch Hand

Joined: Jul 29, 2008
Posts: 275

Hi Sean,

I get the message "Null" is null or not an object. at line 200.

What I want : I want to call a date-picker component on all text fields inside < td class = "datepicker" >

i.e.

I have all the IDs of text fields if required.

I tried



to test if selectors are qorking , but they didn't.
then to test it at unit level .. i tried to change CSS of all text fields.

From your comments I understand, $("text") is the wrong way to call text fields.

I now tried $("*").. still does not work.
Sean Clark
Rancher

Joined: Jul 15, 2009
Posts: 377

Hey,

I'm not really sure what is causing you to have this issue, your jQuery stuff seems ok, but I really can't get my head around all the markup etc in your posted code. Perhaps someone else will be able to help more.

So what code is it stopping at? i.e. what is on line 200?

Sean
Aniruddh Joshi
Ranch Hand

Joined: Jul 29, 2008
Posts: 275

line 200 : $("*").css("border","3px solid red");
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
How about this, create a new page with just a few lines of code. This monster is a waste for us to go through ince 99.9% of it does not apply.

Just make a simple page with jquery and your ready function.

Eric
Aniruddh Joshi
Ranch Hand

Joined: Jul 29, 2008
Posts: 275

that works fine, this mammoth has something wrong in it
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
This is when you break out your debugging hat. Comment everything that is not related to the problem and see if it works. If it does uncomment a little bit more and see if it works. Do it until it breaks. Than you know where the problem is at.

Eric
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Are you kidding me? 2000 lines of HTML? Where some of the lines are like this:Format your code in a meaningful way so we can actually read it without scrolling three screens to the right. Indent it. Remove what isn't relevant.

Look in to CSS--it's really quite handy; I hear people are using it now.

Aniruddh Joshi
Ranch Hand

Joined: Jul 29, 2008
Posts: 275

Eric, dacid,
I agree totally with you. This is an autogenerated code.
I'll format it and paste.

I agree..I can also try with a smaller screen generated at once.
This screen is large.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jQuery not working on page
 
Similar Threads
calling the struts action on jquery button click
struts-2 (set values to action class)
wrapping issue
popup in small window is not closing automatically
ask for the pass value