Skip to main content

How to Refresh or Reload Page using JavaScript

In this tutorial, you will learn how to refresh or reload page using JavaScript.

Sometimes we need to refresh or reload page of a website to load data. As the page refresh or reload is related to client side programming, so we can easily do this using JavaScript. There are methods in JavaScript such as location.reload(), location.href, history.go(0) in JavaScript to load page as per our requirement. We can set timeout or interval to load or refresh page on every given time.

(more…)

Create Dynamic Bar Chart with JavaScript, PHP & MySQL

In our previous tutorial, we have explained how to implement Barcode Generator with JavaScript. In this tutorial, we will explain how to implement Dynamic Bar Chart with JavaScript, PHP and MySQL.

Bar chart or Bar Graph is used to display grouped data with rectangular bars with lengths proportional to the values that they represent. Bar charts are displayed as vertically or horizontally and can be used to display different type of data. The Bar charts are arranged to display from highest to lowest by grouping of data into discrete groups like months of year, age group, sizes etc.

So in this tutorial you will learn how to create dynamic Bar chart with JavaScript, PHP and MySQL. We will use JavaScript plugin Graphite.js to create Bar Chart. You would also like tutorial to build Event Calendar with jQuery, PHP & MySQL to implement in your next project.

We will cover this tutorial with live example to create dynamic Bar Chart.

(more…)

Build Barcode Generator with JavaScript

In our previous tutorial, we have explained how to implement currency converter in PHP. In this tutorial, we will explain how to implement Barcode Generator with JavaScript.

Barcode is a machine readable code that’s generated using product details such as name, code, price etc. Created Barcode tagged on product to get details by scanning it. It’s very useful to manage large inventory and for selling product to identify them quickly.

So if you’re thinking to implement barcode generate functionality using JavaScript instead of server end solutions, then you’re here at right place. In this tutorial you will learn how to generate Barcode using JavaScript. We will use JavaScript plguin JsBarcode to generate barcode. You would also like to create Event Calendar with jQuery, PHP & MySQL to implement in your next project.

We will cover this tutorial in easy steps with live example.

(more…)

Convert CSV Data to JSON using JavaScript with Example

In our previous tutorial, we have explained how to detect DOM changes with JavaScript. In this tutorial, you will learn in easy steps to convert CSV data to JSON using JavaScript with live example.

CSV (comma-separated-values) is a popular file format to store tabular data for further use. It’s very lightweight and easy to parse into different file formats like XML, JSON etc. to use further according to requirement.

So if you’re looking for solution to parse or convert CSV file data into JSON format using JavaScript, you’re here at right place. In comparison with server side CSV data parsing, parsing of CSV data is fast using JavaScript.

(more…)

Observe Changes in DOM using Mutation Observers

In our previous tutorial, we have explained how to convert CSV data to JSON with JavaScript. In this tutorial, you will learn how to Observe Changes in DOM using Mutation Observers in JavaScript when any element added, removed or attribute changed in DOM.

While loading dynamic data with Ajax, we append data with new HTML elements to already loaded HTML page. As the dynamic data HTML appended after DOM load, the existing front-end functionality will not work with new appended HTML element because the specific functions not initialize that new elements.

So we need to detect newly added DOM elements related to that specific functions and then we need to initialize that elements. If you’re struck with such problems and looking for solutions, then you’re here at right place.

The MutationObserver is a JavaScript browser API to detect DOM changes and it’s supported by all modern browsers. We will cover this tutorial with live demo to add dynamic element with attributes to page and then detect newly added element using MutationObserver API API.

(more…)