xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KevinJC <coo...@inl.gov>
Subject doesn't recognize javascript
Date Mon, 03 Sep 2007 14:59:08 GMT

I have a html page which, using the "object" tag loads up the Apache's batik
SBGViewerApplet.  This applet loads an SVG file.  With in the svg file I
have an anchor tag around some text.  When a user clicks on the anchor, I
want to change the fill color of one of the svg objects.  But I don't seem
to be even getting to the javascript.  I get the error:  "A Runtime Erro has
occurred. ....  Line:0  Error: Object expected."  Any kind of help or
suggestions would really be appreciated.  I am new at this so please speak
very slow. :=)


Here is my html:

&lt;html xmlns:xlink="http://www.w3.org/1999/xlink">
&lt;head>
&lt;META http-equiv="Content-Type" content="text/html; charset=utf-16">
&lt;/head>
&lt;body class="Main">
  &lt;object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" 
          HEIGHT="30%" 
          width="100%" 
         
codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4_2_13-windows-i586.cab#Version=1,4,2,13">
    &lt;param name="code" value="SVGViewerApplet.class">
    &lt;param name="archive"
value="batik-all.jar,xerces_2_5_0.jar,js.jar,xml-apis.jar,xml-apis-ext.jar">
    &lt;param name="mayscript" value="true">
    &lt;param name="svgFile" value="kjc_12647.SVG">
    &lt;param name="isSvgContent" value="false">
    [Your browser doesn't seem to support Java applets, which is required to
view the SVG file.]&lt;br>
    &lt;a
href="http://java.sun.com/products/plugin/downloads/index.html">Get the
latest Java Plug-in here.&lt;/a>&lt;/object>&lt;/P>

&lt;/body>
&lt;/html>


Here is my SVG file:

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%"
viewBox="-25 -25 1375 404" preserveAspectRatio="xMinYMin meet" kerning="0"
xml:space="preserve" style="stroke: black; fill: none;" >
<script type="text/javascript"> <![CDATA[ 
function changeColor(P_ID)
{
  // ONCE I get here I want to change the Fill Color for the given ID that
was passed in
  // and perform some other tasks.
  // However, I am never able to get this far.
  alert("we are here");
}
// ]]> 
</script> 

&lt;a xlink:href="Javascript:changeColor('SVG28949');" >
<title>Process Content ChangeLWP-1250-2</title>
<desc>Process</desc>
<rect x="568" y="111" width="263" height="128" style="fill: none; stroke:
rgb(0,0,0); stroke-opacity: 0; stroke-width: 0;">
</rect>
<rect x="568" y="111" width="263" height="128" rx="10" ry="10"
style="stroke: rgb(0,0,0); stroke-opacity: 1.0; stroke-width: 1;"
id="SVG28949">
</rect>

<line x1="568" y1="204" x2="831" y2="204" style=" fill: rgb(255,255,255);
stroke: rgb(0,0,0); stroke-opacity: 1.0; stroke-width: 1;">
</line>

<text x="608" y="140" style=" font-family: Arial; font-size: 12pt;
font-weight: normal; font-style: normal; text-decoration: none;
word-spacing: normal; letter-spacing: normal;  stroke: rgb(0,0,0);
stroke-width: 0.0;  fill: rgb(0,0,0);">Process Content Change</text>
<text x="652" y="159" style=" font-family: Arial; font-size: 12pt;
font-weight: normal; font-style: normal; text-decoration: none;
word-spacing: normal; letter-spacing: normal;  stroke: rgb(0,0,0);
stroke-width: 0.0;  fill: rgb(0,0,0);">LWP-1250-2</text>
<text x="705" y="105" style=" font-family: Arial; font-size: 10pt;
font-weight: normal; font-style: normal; text-decoration: none;
word-spacing: normal; letter-spacing: normal;  stroke: rgb(0,0,0);
stroke-width: 0.0;  fill: rgb(0,0,0);">
</text>
&lt;/a>

</svg>

-- 
View this message in context: http://www.nabble.com/doesn%27t-recognize-javascript-tf4372510.html#a12462708
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message