Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MSBlobBuilder

MSBlobBuilder object

The MSBlobBuilder constructor returns an MSBlobBuilder object.

Internet Explorer 10

 

Syntax


var MSBlobBuilderObject = new MSBlobBuilder();

DOM Information

Inheritance Hierarchy

The MSBlobBuilder does not inherit from any class or interface.

Members

The MSBlobBuilder object has these types of members:

Methods

The MSBlobBuilder object has these methods.

MethodDescription
append

Appends the supplied Blob to the current contents of the MSBlobBuilder object.

getBlob

Returns the Blob object for a given MSBlobBuilder object.

 

Remarks

Use the Blob constructor instead of the MSBlobBuilder constructor.

Examples


<!DOCTYPE html>
<html>

<head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <title>Blob vs. MSBlobBuilder</title>
</head>

<body>
  <p>This text should be red.</p>
	<script>
	  var myBlob;
	  
    window.URL = window.URL || window.webkitURL;
    	  
	  if (window.Blob) {
      myBlob = new Blob(['body { color: red; }'], {type: 'text/css'});  
      appendLinkElement();
      alert("The Blob() constructor was used.");    
	  } 
	  else if (window.MSBlobBuilder) {
      var myBlobBuilder = new MSBlobBuilder();
      myBlobBuilder.append('body { color: red; }');
      myBlob = myBlobBuilder.getBlob('text/css');
      appendLinkElement();
      alert("The MSBlobBuilder() constructor was used.");      
	  } 
	  else {
	    document.getElementsByTagName('body')[0].innerHTML = "<h3>Blob objects not supported - please upgrade your browser.</h3>";
	  }
    
    function appendLinkElement() {
      var link = document.createElement('link');
      
      link.rel = 'stylesheet';
      link.href = window.URL.createObjectURL(myBlob);
      document.body.appendChild(link);    
    } // appendLinkElement
	</script>
</body>

</html>


 

 

Show:
© 2015 Microsoft