SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2009
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Jquery/Javascript not working in jsp file

    I'm a jquery newbie and am trying to use it in a simple web application. This application has a controller servlet that forwards the request to a 'login.jsp' page by default. In the login.jsp page, I used Jquery for the hover effect on the submit button. It works absolutely fine if change the extension of the file to html. If it is changed back to jsp, it the javascript is not working. I see the following error in Firebug console:
    syntax error
    [Break on this error] <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"\n"
    ***Please see the attachments for the login.jsp and login.js files.***

    I have the files 'login.jsp', 'login.js', 'jquery-1.3.2.min.js' under the webapps/QT/jsp/ folder. I think this might be a small problem, but am unable to fix it. Can anyone tell me where I'm going wrong?

    Thanks,
    poluris82
    Attached Files Attached Files

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,784
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Generally in these cases the HTML is being created differently from expected.

    To be able to resolve any issues between the JavaScript and HTML you'd need to post the HTML that the JavaScript is interacting with. What the original JSP looks like that is generating that HTML doesn't matter. What file extensiopn the HTML uses shouldn't matter as long as it can be interpreted by the browser as HTML.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •