javascript

Using multiple Vue instances on the same page

April 18, 2017 by
Part 34 of 55 in the Vue.js: From Beginner to Professional series

We have created a lot of Vue instances in this course so far, but did you ever wonder if you could use multiple Vue instances on the same page? Indeed you can, as you can probably tell based on the below example. <div id="vm1"> <h1>{{ name }}</h1> </div> <div id="vm2"> <button @click="showName">Show name</button> </div> var… read more

Accessing a Vue instance outside of its declaration

April 18, 2017 by
Part 33 of 55 in the Vue.js: From Beginner to Professional series

Until now, we have done all of our work within the Vue instances themselves. But we can also reference these Vue instances by storing them in variables. I have prepared a super simple example which just displays a data property. <div id="vm1"> <h1>{{ name }}</h1> </div> new Vue({ el: '#vm1', data: { name: 'Vue Instance… read more

Microsoft Open Sources its JavaScript Engine

December 13, 2015 by

Apple recently open sourced its Swift programming language, but now Microsoft has decided to open source its JavaScript engine. This follows a trend where the large IT companies open source many technologies. Google and Facebook has done this for a while, but lately Microsoft and Apple have followed suit. Specifically, Microsoft is releasing the Chakra… read more

Selecting Elements by Data Attribute in jQuery

October 13, 2015 by

Selecting elements by data attributes is very easy in jQuery. As with all other attributes, we can simply use the attribute selector. In fact, we do not need to handle the data attribute in any special way, as long as the data attribute is available in the DOM. Please consider the following example. var matches… read more

Selecting Element by Name in jQuery

October 13, 2015 by

Selecting elements based on their name attribute in jQuery is as easy as it should be. We can accomplish this by simply using the attribute selector as follows. For example, to select an input with the name username, use the following selector. var matches = $(‘input[name=”username”]’); Woah, that was easy, wasn’t it?

Getting Query Parameter from URL in JavaScript

September 28, 2015 by

To most people’s surprise, there is not a standard way of accessing query string parameters from JavaScript without first having to parse the query string. Some frameworks and libraries have implemented ways of doing this, but it is not always the case. For example, the ever so popular jQuery has not implemented this, but rather… read more

HTML5 Video Element

July 10, 2013 by

Never has playing video in browsers been so easy. Due to HTML5, it can even be done in a standardized way without requiring third party software to be installed. This article gives an overview of the HTML5 video element along with its JavaScript API.