Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SVG-Scripting errors in IE9

Posted on 2011-03-25
6
Medium Priority
?
1,384 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
  • 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 2000 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

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

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…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

885 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