Posting SVG image

I have created SVG image and its created successfully but not able to post to server side. While posting this image getting exception ,
Uncaught TypeError: Illegal invocation

Is there any special character which need to replace?


Could you show us the code you are using, starting with the call to Diagram.makeSvg?

Below are the code,

self.Print = function () {

            var imgData = myDiagram.makeSVG({
                scale: .5,
                showGrid: true,
                showTemporary: true,
                position: new go.Point(0, 0),
                size: new go.Size(8000, 8000)
            var headerRightText, footerLeftText, footerRightText, incidentId,orgChartType,operationPeriodId
            incidentId = $('#IncidentId').val();
            orgChartType = self.getQueryStringParameterByName('flag');
            operationPeriodId = $('#OperationPeriodId').val();
            var imageDataSource = {
                imageData: imgData,
                incidentId: incidentId,
                operationPeriodId: operationPeriodId,
                orgChartType: orgChartType,

                url: ERMS.CommandPro.IncidentManagement.IncidentForms.IncidentCommandUnit.Urls.SaveImage,
                type: "POST",
                data: imageDataSource,
                success: function (data) {



Try converting the SVG DOM to text first. I think outerHtml() might work.