Scripting over document borders / Alert Box

O

Oliver Knorr

Hello NG,

i'm wondering about a very strange behaviour in a javascript: In my
web application, there are a few SVGs (Adobe SVGViewer 3.0) embedded
by OBJECT-tag in an HTML-File. By starting a (globally known)
JS-Function in the "Menu"-SVG, it creates a new SVG-Node-Tree and
appends it to a anchor-Node in an "Display"-SVG. This means, a
function called in one document creates SVG-Eelements in another
document. This works fine, if a simple JS-alert is included at the
beginning of the SVG-creation-process. If not, it doesn't work - no
SVG is created. IMHO, i can exclude a runtime error, for that i
analyzed it quite intensive. In my opinion, the problem could deal
with restrictions on scripting over document borders. Nevertheless, i
don't understand it. Does anybody have experience with that kind of
behaviour? Does an alert have such influence on something like a
"focus" on a document?

Help would be appreciated,

Oliver
 
B

Berislav Lopac

Oliver said:
Hello NG,

i'm wondering about a very strange behaviour in a javascript: In my
web application, there are a few SVGs (Adobe SVGViewer 3.0) embedded
by OBJECT-tag in an HTML-File. By starting a (globally known)
JS-Function in the "Menu"-SVG, it creates a new SVG-Node-Tree and
appends it to a anchor-Node in an "Display"-SVG. This means, a
function called in one document creates SVG-Eelements in another
document. This works fine, if a simple JS-alert is included at the
beginning of the SVG-creation-process. If not, it doesn't work - no
SVG is created. IMHO, i can exclude a runtime error, for that i
analyzed it quite intensive. In my opinion, the problem could deal
with restrictions on scripting over document borders. Nevertheless, i
don't understand it. Does anybody have experience with that kind of
behaviour? Does an alert have such influence on something like a
"focus" on a document?

On a first look, it seems that it might have something to do with loading
files. If you load your SVG files, it is quite possible that it isn't yet
loaded when JS tries to access the object; the alert creates necessary delay
(before you click the button). You should include some test for load status,
and use the objects only after they are completely loaded.

Berislav
 
O

Oliver Knorr

Hello Berislav, thank you for your reply.

The concerned files are already loaded and t5he SVG is created
dynamically. For a better imagination: after clickingh on a Button in
one (menu-)document, SVG-Nodes are created in another, empty
(toolbar-)document. Can you figure it out?
So, there's no runtime aspect in this problem.

Thanks, Oliver
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top