Dynamic src modification in Adobe SVG View

Source: Internet
Author: User

Today, I want to dynamically modify the SRC of the SVG view in the project to avoid the use of the framework (the previous solution was to refresh the framework page of the view). The solution is as follows:

 

 

 

 VaR embedtag = Document. getelementbyid ("embed1 ");
VaR oparent = embedtag. parentnode;
Oparent. removechild (embedtag );
VaR oembed = Document. createelement ('embed ');
Oembed. src = "treeinfo. aspx? Id = "+ node. ID + '. SVG ';
Oembed. width = "800 ";
Oembed. Height = "600 ";
Oembed. ID = "embed1 ";

Oparent. appendchild (oembed );

 

 

Embed1 is the ID of the <embed> element.

The dynamic SRC address is treeinfo. aspx? Id = "+ node. ID + '. SVG'

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.