• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Javasctipt problem

 
anjali ray
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic