Applies to: SharePoint Foundation 2010
In this article
Imports a Web Part from a string in the .dwp format.
var value = SP.WebParts.LimitedWebPartManager.importWebPart(webPartXml);
The Web Part markup to import.
After importing, the Web Part is not added to a Web Part Page. To add a Web Part to a Web Part Page, use addWebPart, supplying the object returned by this method.
When Scope is User, the current user must have permissions to add and delete personalized Web Parts. When Scope is Shared, the current user must have permissions to customize pages.
It must not be null. It must not be empty. It must be valid XML in the .dwp or .webpart format.