• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

How to call JavaScript Function from jsp

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have to call a javascript function which is not defined in the jsp file.

The function "cancelButton" is defined in "xyz.js", like...

I want to call this function from "abc.jsp".
How can i call?
What are the syntaxs to call that function.

Regards
Ganesan K
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm assuming that you're not trying to call a Javascript function from JSP code. This can't be done.

Moving to the HTML/Javascript forum where Javascript issues are covered.
 
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the head of the jsp, add this:
<script language="javascript" type="text/javascript" src="xyz.js"></script>

Then you can just call the function like it was included in the jsp.
 
Marshal
Posts: 67418
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Dom Lassy:

Then you can just call the function like it was included in the jsp.



"Like" it was included? That does include it. No "like" about it.
[ August 02, 2006: Message edited by: Bear Bibeault ]
 
    Bookmark Topic Watch Topic
  • New Topic