error when refreshing

Anonymous
06-17-2004, 03:19 PM
i'm using a html and javascript file that embeds a svg
the page loads fine, but when you refresh the page it makes a runtime error.
any1 know whats going on?

jon - svg
06-17-2004, 10:11 PM
Hi,

hmm, I'm not sure what the problem could be. I think we will need to see the javascript and SVG. And name your browser.

Learn SVG - http://learnsvg.com

Anonymous
06-18-2004, 08:51 AM
The file is pretty big, but here is the entire javascript section:

<script type="text/javascript">
var svgDoc = document.theSVG.getSVGDocument();
var nodes = svgDoc.getElementsByTagName("circle");
svgDoc.rootElement.addEventListener("SVGZoom", syncCircle, false);

function toggle_circles(checkbox) {
if(checkbox.checked) showcircles = 'hidden';
else showcircles = 'visible';

for(i=0; i<nodes.length; i++)
nodes.item(i).setAttributeNS(null,'visibility', showcircles);
}

function syncCircle()
{
var s = 1/svgDoc.rootElement.currentScale;
for(i=0; i<nodes.length; i++)
{
nodes.item(i).setAttribute("r", .0005*s);
}
}
</script>

Cast
06-28-2004, 10:13 PM
Hi, I have a similar problem refreshig a SVG document. First I open it in IE, then, I modify it with a external java class, then, I refresh the SVG document and I dont know if the IE browser or the ASV6 doesnt work well. Only some parts are refreshed and other some arent even drawn. I really dont know who is causing this problem.

Please I need some help with this ...


Thanks ...

Anonymous
06-29-2004, 10:36 AM
Mine has a problem even without any modifications.
If you load the page and then, without doing anything else, hit refresh, it'll give an error.

Anonymous
08-11-2004, 03:53 AM
The file is pretty big, but here is the entire javascript section:

<script type="text/javascript">
var svgDoc = document.theSVG.getSVGDocument();
var nodes = svgDoc.getElementsByTagName("circle");
svgDoc.rootElement.addEventListener("SVGZoom", syncCircle, false);

function toggle_circles(checkbox) {
if(checkbox.checked) showcircles = 'hidden';
else showcircles = 'visible';

for(i=0; i<nodes.length; i++)
nodes.item(i).setAttributeNS(null,'visibility', showcircles);
}

function syncCircle()
{
var s = 1/svgDoc.rootElement.currentScale;
for(i=0; i<nodes.length; i++)
{
nodes.item(i).setAttribute("r", .0005*s);
}
}
</script>

Anonymous
08-16-2004, 07:50 AM
Same problem here. The curious thing is, sometimes it actually does work.
My guess is that this is some kind of race condition. The page and the plugin load the content concurrently, but the plugin has to be finished loading for the HTML page to access the document root. (just a thought) Is there a way to ensure that the plugin has finished parsing?

 
Web mp2kmag.com
mapforums.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum