Solved

SVG-Scripting errors in IE9

Posted on 2011-03-25
6
1,377 Views
Last Modified: 2012-06-22
Hi,
we have some trouble with the new IE9.
Our scripts are filled with methods like getSVGDocument() oder getStyle(), for example:

Node.item(i).getStyle().setProperty("visibility","hidden");
svgdoc = document.myName.getSVGDocument();

The Browser throw the error "unknown name" for this methods. Has anybody a workaround for this?

Thank you in advance.

Holger
0
Comment
Question by:Cut_OS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 9

Expert Comment

by:iGottZ
ID: 35213913
posting an amount of 2 lines of code doesnt help us helping you.
in order to get serious help about this topic you should show us some more code.
0
 

Author Comment

by:Cut_OS
ID: 35214116
OK, another try:

function incrementGuillotineLevel(Obergrenze)
{
    UnHighlight_Streifen();
    ShowKlemmer(0,0);
    var Untergrenze = 1;
    var Value = document.forms["Interaktiv"].elements["Guillotine"].value;
    var svgdoc = document.Guillupanddown.getSVGDocument();
    var up = svgdoc.getElementById('upGuil');
    var down = svgdoc.getElementById('downGuil');
    if (Value > Obergrenze)
    {
        Value = Obergrenze;
        up.getStyle().setProperty('visibility', 'hidden');
    }
    if (Value < Untergrenze)
    {
        Value = Untergrenze;
        down.getStyle().setProperty('visibility', 'hidden');
    }
    else
    {
        if (Value != Obergrenze)
        {
            Value++;
            if (Value == Obergrenze)
            {
                up.getStyle().setProperty('visibility', 'hidden');
            }
            if (Value > Untergrenze)
            {
                down.getStyle().setProperty('visibility', 'show');
            }
        }
    }
    document.forms["Interaktiv"].elements["Guillotine"].value = Value;
    showPrimStripes(Value);

    var svgdoc2 = document.upanddown.getSVGDocument();
    var up2 = svgdoc2.getElementById('upZyklus');
    var down2 = svgdoc2.getElementById('downZyklus');
    down2.getStyle().setProperty('visibility', 'hidden');
    document.forms["Interaktiv"].elements["Zyklus"].value = 0;
    document.forms["Interaktiv"].elements["SubZyklus"].value = 0;
    if (MaxZyklus > 0)
    {
        up2.getStyle().setProperty('visibility', 'show');
    }
    else
    {
        up2.getStyle().setProperty('visibility', 'hidden');
    }
    return;
}

I'm using getSVGDocument() 44 times in the script-file, and getStyle() 93 times.
0
 
LVL 1

Accepted Solution

by:
BitBlitz earned 500 total points
ID: 35407919
getSVGDocument only works in the IE9 document mode, and only on an embedded element.

E.g. what is the markup around upanddown?

instead of getStyle, try just .style.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Cut_OS
ID: 35431648
@BitBlitz
Thank your for your answer and solution!
I have found the entered IE7 document mode in the developer tool of the IE9 last week. Since then I'm using the meta-tag <meta http-equiv="X-UA-Compatible" content="IE=9" > (We will deliver the IE9 shared with our MFC software). So i can using getSVGDocument for the svg via object-tag now, when i define "application/xhtml+xml" as MIME-Type.
Other svg elements, like "upanddown", i have using now inline in the html document, so i can access direct via getElementByID("upanddown").

.style instead of getStyle is working perfectly.

The script is working with the IE9 now, but it was a hard time. I look forward to the new IE...
0
 
LVL 1

Expert Comment

by:BitBlitz
ID: 35431783
Happy to help.
Please accept and rate my solution.
Thank you.
0
 

Author Comment

by:Cut_OS
ID: 35433796
Now i have another problem...
When the embed svg-file is located on a network-drive, the IE9 is throwing many script-errors, like "access denied". Where is the one checkbox in the IE settings i have to click? :-(
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
This article discusses how to implement server side field validation and display customized error messages to the client.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question