Onload An event in an inline SVG function that does not call when the script is connected. Problem?

So I have an XHTML page with a script - not inline

> <script type="text/javascript"
> src="../global/js/scripts.js"></script>

      

and inline (I tried to insert and object, same behavior) SVG document with onload = "CheckIfLoaded (evt)" attribute.

The problem is firefox is not calling the CheckIfLoaded () function in scripts.js. Firebug gives me "CheckIfLoaded () not defined" without referencing any line numbers. I can't find any information on the javascript scope for inline content. Curiously, it works great in IE.

I could of course add a script reference to the SVG file, but I believe this will cause the client to download the script file twice and furthermore, I will have 1000+ svg files and I would rather not add one line to all of them, although I assume I can write a batch file or whatever if I need to.

Does anyone know about this?

+2


a source to share


2 answers


Do you have an onload on the svg element or on the object / embed tag?



It looks like you want to call functions in the reference ("parent") document, see examples here .

0


a source


Are you sure the script is loading? Are there any errors in the error console? If you put warning () in your script, can you see it? (Before or after the warning () you put in your onload handler?)



0


a source







All Articles