Scripting over document borders / Alert Box

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Oliver Knorr

    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
  • Berislav Lopac

    #2
    Re: Scripting over document borders / Alert Box

    Oliver Knorr wrote:[color=blue]
    > 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?[/color]

    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.


    Comment

    • Oliver Knorr

      #3
      Re: Scripting over document borders / Alert Box

      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!

      Comment

      Working...