Hi Erik,
I created my program "CoverageDemo" within following directory structure -
<ApacheGroup>
<Tomcat5.0>
<webapps>
<orbeon>
<WEB-INF>
<resources>
......
......
<CoverageDemo>
<_javascript_/>
</CoverageDemo>
.....
<_javascript_/>
<WebStyle/>
.....
.....
</resources>
</WEB-INF>
</orbeon>
</webapps>
</Tomcat5.0>
</ApacheGroup>
For testing purpose, I placed "CoverageActions.js" in both _javascript_ directories : \ApacheGroup\Tomcat5.0\webapps\orbeon\WEB-INF\resources\_javascript_
and \ApacheGroup\Tomcat5.0\webapps\orbeon\WEB-INF\resources\CoverageDemo\_javascript_
This _javascript_ has a global variable "UWSCoverageAction" set to TRUE as follows : var UWSCoverageAction = true;
So, if _javascript_ loads successfully, this variable will be available. I've used this variable in XHTML to check if the _javascript_ is loaded or not -
<head>
<link rel="stylesheet" type="text/css" href="">
<script type="text/_javascript_" src="">
<script>if (typeof(UWSCoverageAction) == "undefined") alert("Could not load CoverageActions.js");</script>
</head>
It works fine if used in plain HTML and opened in browser; but gives error message "Could not load CoverageActions.js" if used in XHTML and rendered through Orbeon. I tried other ways to give path in "src" like "./_javascript_/CoverageActions.js" , "_javascript_/CoverageActions.js" etc but nothing worked.
The final HTML produced by Orbeon is -
<!DOCTYPE html
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<link rel="stylesheet" href="" type="text/css"><script type="text/_javascript_">if (typeof(UWSCoverageAction) == "undefined") alert("Could not load CoverageActions.js");</script><script type="text/_javascript_" src="">
<body += ''">
....
....
Please let me know if I'm doing it incorrectly.
Regards,
Rahul
----------------------------------------------------------------------------------------
This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.
----------------------------------------------------------------------------------------
| Erik Bruchez <ebruchez @orbeon.com> Sent by: orbeon-user-admin 10/27/2004 10:10 PM
|
To: [EMAIL PROTECTED] cc: Subject: Re: [orbeon-user] Including _javascript_ in XHTML |
Hi Rahul,
You should just be able to include the script as you are doing below. Put your
src attribute can simply be absolute (within your servlet context), as
Presentation Server rewrites XHTML URLs automatically. So you should be able
to write <script src="">
If this doesn't work, could you be more specific about what doesn't work, i.e.
what is the resulting HTML source in your browser, for example? Is the path to
the script incorrect?
-Erik
Rahul Agarwal wrote:
> Hi,
>
> Does someone know, how can a _javascript_ file be included and used in a XHTML
> using Orbeon? I tried following syntax but it did not work. If you can provide a
> sample program, it will be of great help.
>
> <html xmlns="http://www.w3.org/1999/xhtml"
> xmlns:ev="http://www.w3.org/2001/xml-events"
> xmlns:fo="http://www.w3.org/1999/XSL/Format"
> xmlns:prefix="http://www.w3.org/2002/xforms"
> xmlns:xforms="http://www.w3.org/2002/xforms"
> xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
> xmlns:xhtml="http://www.w3.org/1999/xhtml"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <head>
> <script language="_javascript_"
> src=""> > </script>
> </head>
> <body>
> <xforms:group
> ref="/Root/ACORD/InsuranceSvcRs/*/......" xhtml: DoSubmit(this)">
> ....
> ....
>
>
> Regards,
> Rahul Agarwal
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
orbeon-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/orbeon-user
