• 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
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

How can you invoke a JavaScript within JSP code?

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
Am trying to invoke a Javascript file from a JSP, but not successful.
Can u pls help me???
I am doing it in this way in the JSP code.
<head>
<script language="javascript" src = "pagename.js">
</script>
</head>

This doesn't invoke the Javascript at all.
What could be the reason and also the solution please.
Thanks in advance.

Mahesh
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what you are doing here is making the javascript file availabe to the JSP code. Have you tried calling any of the functions in your .js fikle and it did not work?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you really trying to run the Javascript on the server side? Javascript is primarily a client side technology.
Assuming you want it to run on the client side, I would start with a plain HTML page that does what you want, then try to create exactly that from JSP.
Bill
 
reply
    Bookmark Topic Watch Topic
  • New Topic