You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by jill han <jh...@bynum.com> on 2009/01/05 16:31:43 UTC
load a file through javascript
We have a turbine/torque/velocity application. I tried to embed AnyChart
to the app. Here is the snippet of anychart.vm code
<script type="text/javascript" language="javascript">
//<![CDATA[
var chart1 = new
AnyChart("$content.getURI("swf/AnyChart.swf")");
chart1.width="550px";
chart1.height="400px";
chart1.setXMLFile("$content.getURI('servlet/nequals1/template/portal,dat
a,data.xml')");
chart1.write();
//]]>
</script>
AnyChart.swf is read fine. However, for some reason, the data.xml file
couldn't be read properly. It ended up with IO error.
Any help and suggestions will be appreciated as always.
Jill
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: load a file through javascript
Posted by Thomas Vandahl <th...@tewisoft.de>.
Sorry, wrong sender.
jill han wrote:
> chart1.setXMLFile("$content.getURI('servlet/nequals1/template/portal,dat
> a,data.xml')");
[...]
> AnyChart.swf is read fine. However, for some reason, the data.xml file
> couldn't be read properly. It ended up with IO error.
I'd use "$link.setPage('portal,data,data.xml')" for the link. $content
is for static content only.
Bye, Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: load a file through javascript
Posted by Thomas Vandahl <th...@medav.de>.
jill han wrote:
> chart1.setXMLFile("$content.getURI('servlet/nequals1/template/portal,dat
> a,data.xml')");
[...]
> AnyChart.swf is read fine. However, for some reason, the data.xml file
> couldn't be read properly. It ended up with IO error.
I'd use "$link.setPage('portal,data,data.xml')" for the link. $content
is for static content only.
Bye, Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: load a file through javascript
Posted by Nathan Bubna <nb...@gmail.com>.
Sounds like a question for whoever created AnyChart, because Velocity
is entirely server-side. Velocity is not doing the loading of the xml
file, the javascript is doing that.
On Mon, Jan 5, 2009 at 7:31 AM, jill han <jh...@bynum.com> wrote:
> We have a turbine/torque/velocity application. I tried to embed AnyChart
> to the app. Here is the snippet of anychart.vm code
>
> <script type="text/javascript" language="javascript">
> //<![CDATA[
> var chart1 = new
> AnyChart("$content.getURI("swf/AnyChart.swf")");
> chart1.width="550px";
> chart1.height="400px";
>
> chart1.setXMLFile("$content.getURI('servlet/nequals1/template/portal,dat
> a,data.xml')");
> chart1.write();
> //]]>
> </script>
>
> AnyChart.swf is read fine. However, for some reason, the data.xml file
> couldn't be read properly. It ended up with IO error.
> Any help and suggestions will be appreciated as always.
>
> Jill
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org