Category Archives: Vue.Js Blog

Vue.js set hash URL


We can use native javascript location.hash property to hash(#) url. Here in this artical we are going to explain how you can use this property in vue.js. You can also use our online editor to edit and run the code online.


Vue.js set hash URL JavaScript Example

You can set the hash url string in vuejs simply as below-

Example:

{{result}}

The above example will set new hash(#) url.

Output of above example-

Vue.js set hash url string

Vue.js get hash from URL


We can use location hash property to get the hash(#) part from url. Here in this tutorial, we are going to explain how you can get the hash(#) from url in Vue.js. You can also use our online editor to edit and run the code online.


Vue.js get hash from URL JavaScript Example

If you want to get the hash from url, you can use the below syntax-

Example:

{{result}}

Output of above example-

Vue.js get hash from URL Example

Vue.js Get Browser User Agent


Navigator userAgent Property is used to get the browser user agent property. Here in this tutorial, we are going to explain how you can get the user-agent header sent by browser.


Vue.js Get Browser User Agent Example

You can get the user-agent in vue.js simply as below-

Example:

{{result}}

Try it »

Output of above example-

Vue.js Get Browser User Agent

Vue.js get browser Platform

We can use navigator platform property to get the platform of browser on which it is running. Here in this tutorial, we are going to explain how you can use native JavaScript navigator platform property.You can use our online editor to edit and run the code online.


Vue.js get browser Platform Example

You can get the browser platform simply as below-

Example:

{{result}}

Try it »

Output of the above example-

Vue.js get browser platform

Vue.js Detect Browser Language


We can use navigator language property to get the language of the browser. Here in this tutorial, we are going to explain how to detect browser default language in vuejs. You can use our online editor to edit and run the code online.


Vue.js Detect Browser Language Example

navigator.language is used to get the browser language. Here is an example of browser language.

Example:

	

{{result}}

Try it »

Output of above example-

Vue.js Detect Browser Language
This is read only property.

Vue.js Get Geolocation


We can use navigator geolocation property to get the current location of visitor(user) in JavaScript. You can use the same native JavaScript geolocation property in Vue.js.


Vue.js Get Geolocation | Lat | Lon Example

Using geolocation property we can get user’s lattitude and longitude. You can use navigator geolocation property in Vue.js Simply as below-

Example:

Lat = {{lat}} Lon ={{lon}}

{{error}}

Try it »

Note : This property works with SSL enabled urls.
Note : This property supports read only.

Vue.js check Cookie is Enabled


We can use native JavaScript navigator cookieEnabled property to check whether the cookie is enabled or not on browser. Here in this tutorial, we are going to explain how you can use navigator cookieEnabled property in vue.js. You can also use our online editor to edit and run the code online.


Vue.js check Cookie is Enabled Example

You can check whether cookie is enabled or not simply as below-

Example:

Result = {{result}}

Try it »

Output of above example-

Vue.js check Cookie is Enabled

Vue.js Get App Code Name Of Browser


We can use native JavaScript Navigator appCodename Property to get the App code name in Vue.js. Here in this tutorial, we are going to explain how you can get appCodeName in vue.js. You can also use our online editor to edit and run the code online.


Vue.js Get App Code Name Of Browser JavaScript

Here is an example of native JavaScript appCodeName property-

Example:

Browser CodeName = {{result}}

Try it »

If you run the above example it will produce the output something like this-

Vue.js Get App Code Name Of Browser

Vue.js Window Print


We can use window print method to print the current window page. Here in this tutorial, we are going to explain how you can use JavaScript Window Print method.


Vue.js Window Print Method Example

We can use window.print() method to print the current window in vue.js-

Example:

Try it »

Output of above example-