469,903 Members | 1,553 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

Scripting over document borders / Alert Box

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
Jul 23 '05 #1
2 1213
Oliver Knorr wrote:
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

--
If the Internet is a Marx Brothers movie, and Web, e-mail, and IRC are
Groucho, Chico, and Harpo, then Usenet is Zeppo.
Jul 23 '05 #2
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
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Shabam | last post: by
3 posts views Thread by flosi | last post: by
2 posts views Thread by kw | last post: by
3 posts views Thread by Vongza | last post: by
6 posts views Thread by avh | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.