1

im trying to use svg4everybody to render svg icons in Internet explorer 11, im using salesforce lightning design system.

im having an error Sarissa is undefined.

this is my code:

<apex:page standardStylesheets="false" controller="FP_VFC_FootprintListView" tabStyle="FootPrint__c" id="EntirePage" sidebar="false" action="{!FeedbackInit}">
    <apex:slds/>
    <html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
        <div class="slds-scope"> 
            <head>
                <apex:includeScript value="{!URLFOR($Resource.svg4everybody)}"/>    
                <script>
                alert('svg');
                    svg4everybody();
                </script>
            </head>
            <body>
                <svg aria-hidden="true" class="slds-icon slds-icon--x-small slds-icon-text-default">
                    <use xlink:href="{!URLFOR($Resource.footprintAll, '/FootprintZip/Footprint/SLDS202/assets/icons/utility-sprite/svg/symbols.svg#info')}"></use>
                </svg>
                <svg aria-hidden="true" class="slds-button__icon slds-button__icon--large">
                    <use xlink:href="{!URLFOR($Resource.footprintAll, '/FootprintZip/Footprint/SLDS202/assets/icons/utility-sprite/svg/symbols.svg#delete')}"></use>
                </svg>
            </body>
        </div>
    </html>
</apex:page>

2 Answers 2

0

I can suggest you can call the svg icons as :

<span class="slds-icon_container slds-icon-standard-account" title="description of icon when needed">
  <svg aria-hidden="true" class="slds-icon">
    <use xlink:href="{!URLFOR($Asset.SLDS, 'assets/icons/standardsprite/svg/symbols.svg#account')}"></use>
  </svg>
  <span class="slds-assistive-text">Account Icon</span>
</span>

Try and let me know if it works?

0

I assume you are getting this error cause you have added code to check for Sarissa originalXMLHttpRequest in svg4everybody script. I was having the same issue with this script. please add the following lines to the script.

var XMLHttpRequest;
if(typeof Sarissa !== 'undefined' && Sarissa.originalXMLHttpRequest) {
   var XMLHttpRequest =  Sarissa.originalXMLHttpRequest;
} 
else{
    var XMLHttpRequest = window.XMLHttpRequest;
}

This resolved the issue for me. Hopefully, it does it for you too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.