Live update / hot reload / browser sync

You need Node.js for this. You can install BrowserSync using the command :

npm install -g browser-sync

Then browse to your project directory and open browsersync using :

browser-sync start --server --directory --files "*"

This will open a new tab in your browser which will list files in the directory, you can then select a html file to load and you should see a Connected to Browsersync message on the top right. This will also track changes in all files in your current directory and update the page whenever any file changes.

Master Yushi

Select a SharePoint WebPart Item with jQuery

Kode i .ascx file:

<asp:Label ID="lblSomeLabel" runat="server"></asp:Label>

Kode i endelig html:

<span id="ctl00_m_g_6fb87798_677a_4b2e_804d_6cb23c3672d1_ctl00_lblSomeLabel"></span>

Så hvordan fanger man elementet fra JavaScript?

  "use strict";
  var $lblSomeLabel = $("[id$='_lblSomeLabel']");

Læs mere på

Attribute Ends With Selector [name$=”value”]