0 comment

this.domElement is your new document object in SPFx web parts development

You are familiar with the JavaScript method like ‘document.getElementByID’. Since HTML5 the Document Object Model has more to offer than return an element by its ID on a document.

Use this.document instead of document

Use this.document instead of document

I case of web part development you should forget that the document object inside and HTML exists instead you should request HTML elements differently.

[Read more]

0 comment

Alternative to innerHTML in SharePoint Framework web parts

When you create a new project without any framework, the default web part content in the code will be added through innerHTML.
Technically there is nothing wrong with this approach, but you might run into a problem when you add more content to the web part afterward using the same method. In this case, the previously added content will be overwritten.

To avoid this behavior, you can use jQuery and the ‘append‘ or ‘prepend‘ methods to add your content. It works well but requires an external library.
Instead of using jQuery, there is a native method in the document object model of HTML available.

[Read more]


SPFX Sample – Drag and Drop elements across web parts

The SharePoint framework improved a lot during the last drops. I thought to myself what fancy sample can I build using the framework. During the Hackathon at the European SharePoint Conference we saw a lot of great uses of this new framework. One team was even able to add a framework web part to SharePoint 2007.
Actually, last weekend I came up with an idea. It was more a proof of concept I would like to try. I asked myself the question. Will I be able to drag and drop data between two individual web parts.
[Read more]

1 comment

HTML 5 Rocks – Where to find information ?

Nearly thirteen years ago i wanted to start building web sites. I asked a friend who already was familiarly with HTML how to learn The answer was simple “Go to Read HTML specification. Read CSS specification. After you know all those specification”. At this time it sound like a useful information to me. I learned those specification and start writing.

Nowadays i’m right back where is started. I started reading HTML5 and CSS3 specification again. The reason for this is simple. Good HTML 5 informations are hard to find and the only facts are those specifications. Most of the information i found on the web are wrong or just partial right.

Probably the best information to learn from is the HTML Working Group. The maintainer of the HTML 5 specification. For some defined html tags in the specification there are a remark on supporting browser too and you find useful examples.

Afraid of using HTML5 today ? Don’t be scared you can use it, even if someone uses IE6. Bruce Lawson have some really good information on HTML5. His test page introduces new tags like:

  • <header>
  • <nav>
  • <article>
  • <aside>
  • <footer>

Those are the prime information for me at the moment.

A bad example on HTML5 is It deals a nice graphic on HTML5 and CSS3 from a browser point of view. The problem with this site is the mixture no HTML5 features and false information. For example SVG, Geolocation are not defined in the HTML5 or CSS3 specification. The caniuse site is useful but html5 readiness puts in a wrong context.

Googles provide a great range of information but it has the same mixture of no HTML5 features. So you won’t get exactly a clue what HTML5 really is.

Alt those information has a right to exist, but i really like hard facts more.

Soon i will provide more useful information on HTML5.