This content has been marked as final.
Show 3 replies
-
1. Re: JavaScript & jsp: can't load external script
diondodgen Sep 5, 2005 10:49 AM (in response to hannes)Hi Hannes,
Well looking at this I would check to see what the application context name of my portlet is. This should provide a bit of information of your path to your war file resources.
Then make sure the<script src= "" />
matches the path of your portlet war.
Your current path says that the grid.js is in the root folder of the core-war and I don't think you have it here.
I would pop the .js file under my /WEB-INF directory in another folder of your portlets war so
/WEB-INF/javascript/grid.js then reference it in the jsp script tags<script src="WEB-INF/javascript/grid.js" />
or something like this.
I hope this helps.
Dion -
2. Re: JavaScript & jsp: can't load external script
hannes Sep 6, 2005 5:18 AM (in response to hannes)Thank you for your reply :)
"diondodgen" wrote:
Hi Hannes,
Well looking at this I would check to see what the application context name of my portlet is. This should provide a bit of information of your path to your war file resources.
hmm, what do you exactly mean? I can retrieve only the 'portlet context name' [doView]PortletContext context = getPortletContext(); System.out.println(context.getPortletContextName());
But the value is null."diondodgen" wrote:
Then make sure the<script src= "" />
matches the path of your portlet war.
Your current path says that the grid.js is in the root folder of the core-war and I don't think you have it here.
yes it is located there. Otherwise it can't be found (no syntax error in the js-console)."diondodgen" wrote:
I would pop the .js file under my /WEB-INF directory in another folder of your portlets war so
/WEB-INF/javascript/grid.js then reference it in the jsp script tags<script src="WEB-INF/javascript/grid.js" />
I've tried that, but I can only access the (and other) file(s) in the root folder of the war where the jsp is located. Should I define the *.js and *.css as a resource?
But I think, the main problem still stays: the js-console delivers the syntax error:Error: syntax error
and this causes the other error 'Active is not defined'. Unfortunately the source of the js-file is totally illegible. I cant locate the error.
Source File: http://localhost:8081/portal/grid.js
Line: 8
Source Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Maybe someone want to try out the table (licenced under the GPL):
http://www.activewidgets.com/download/activewidgets-grid-1.0-gpl.zip
Regards,
Hannes -
3. Re: JavaScript & jsp: can't load external script
hannes Sep 6, 2005 5:58 AM (in response to hannes)It is a bug in the javascript from activewidgets. I am not allowed to have
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
in my html-page. I am trying to remove the line from the index.jsp.
But why I can access only files from the root folder is still confusing...