File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Portals and Portlets and the fly likes Javasctipt problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Portals and Portlets
Reply Bookmark "Javasctipt problem" Watch "Javasctipt problem" New topic
Author

Javasctipt problem

anjali ray
Greenhorn

Joined: Mar 12, 2005
Posts: 28
Does anybody have an example of how to include javascript in a portlet and call the function. I am trying an example by including js on the jsp page
like :
<sscript type ="text/javascript" src="test.js">
I have the js file in the same location as the jsp page.
I am getting an error saying:
"Object doe not allow call"
Thanks in advance for any help.
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4962

How are you referring to your JS file? Are you namespace encoding?

To reference an image in a portlet, you use code like this:



This assumes the /images/ folder is directly off the root of the war file. Perhaps the js file isn't being referenced appropriately.

I have a tutorial on displaying images in a JSR168 portlet, which might help. Referencing an image, and referencing a .js resource file are somewhat similar tasks in theory.

Referencing Resources Packaged within a Portlet War File

Good luck!

-Cameron McKenzie


Author of Hibernate Made Easy, What is WebSphere???, JSF 2.0 Made Easy and the SCJA Certification Guides
 
 
subject: Javasctipt problem
 
Threads others viewed
Calling javascript function in js file from JSP
How to call a JSP file within a JavaScript file
JSP page with js file compression
linking to external js
Can't include .js file on jsp page controlled by front controller servlet
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com