Home » Archive

Articles tagged with: Javascript

Google, Javascript »

[3 Oct 2017 | Comments Off on Google Maps: Get Latitude/Longitude value on Click and on Mouse Move]

This article shows how to get latitude and longitude value when you click or move the mouse over Google Map.
In previous article, we had seen how we can Display Google Map with Marker when we have latitude and longitude value.

Google, Javascript »

[26 Sep 2017 | Comments Off on Google Maps: Create New Marker on Clicking the Map]

This article shows how to create a new marker whenever you click or double click on the Google Map.
In previous article, we had seen how we can Display Google Map with Marker when we have latitude and longitude value.
Here, we will be using the same code and adding a new functionality of displaying a new marker whenever users double click on the map. You can also add this functionality on “single click” instead of “double click” event. I will be showing both in the example code below.

Google, Javascript »

[19 Sep 2017 | Comments Off on Display Google Map with Marker using Latitude & Longitude Coordinates]

This article shows how you can generate Google Map and display it in your webpage when you have latitude and longitude coordinates value.
We will be using HTML and Javascript to display the Google Map.

Node.js »

[8 Aug 2017 | Comments Off on Node.js & Express: Templating using EJS]

This article show how you can use Embedded Javascript (EJS) in your Node.js & Express application. EJS is an open-source Javascript Template Library.
There are different other Javascript Templating languages/libraries like Mustache, Pug, Jade, etc. which can also be used in your Node.js & Express application. This tutorial uses EJS as the templating language for our Node & Express example app.

AngularJS »

[3 Jul 2017 | One Comment]

This article presents a basic introduction to AngularJS 1.x. AngularJS is a free and open source Javascript Framework. It’s a frontend web application framework maintained by Google.
AngularJS follows the MVC (Model View Controller) approach of coding. Two way data-binding is a prominent feature of AngularJS which automatically synchronizes data between model and view components. This allows automatic updates in model whenever view changes and vice-versa. There are other great features like Dependency Injection, Services, Filters, Directives, etc.

Javascript »

[13 Mar 2017 | Comments Off on Javascript: Populate Select box OnChange with JS array/object]

This article show how to populate one select box by selecting option of another select box/list. We will use a Javascript object. Each key of the object contains array as value.
A first select box is populated with the Javascript object’s keys. Then when the value from the first select box is selected then based on that value, the second select box is populated.

Google AppScript »

[23 Jan 2017 | Comments Off on Google AppScript: Basic/Beginner Introduction [TUTORIAL]]

This tutorial provides a very basic introduction to Google App Script. I will also list out the works that can be done with AppScript. And, I will be showing very basic Javascript code that can be run on AppScript’s console. In this article, we will be dealing only with Javascript arrays and loops.
What is Google AppScript?

Magento »

[10 Mar 2016 | Comments Off on Magento: Using AJAX with Prototype JS]

This article shows how to use AJAX on Magento with Prototype Javascript Library.
I had one scenario where I had to check whether a customer is already registered or not via AJAX.

Magento »

[7 Dec 2015 | One Comment]

In Magento Admin form, you have two fields. One is a select field and let the other field be a text field. Now, you want to show/hide the text field based upon the option selected in the select field.

Javascript »

[15 Oct 2012 | One Comment]

This article shows how to get selected value from dropdown box when a button is clicked.
– There are multiple forms in a page.
– There is a dropdown select box in each form.
– The option value of the select box is website URL.
– There is a button type=button (not type=submit) in each form.
– User will select a value from the select box and click the button.
– I need to get the selected option value (which is website URL) and open the URL in new window.

Javascript »

[2 Jan 2012 | Comments Off on Javascript: How to Submit form and Change form action?]

This article will show you how to submit form and change form action using javascript. This is a very simple trick but it’s very useful and frequently used.
Submit Form using Javascript

Javascript »

[26 Sep 2011 | Comments Off on Javascript: Show Hide textbox text on focus]

This might be simple one but it is a very handy code. Generally, I see this being used in Search textbox where there is some text like ‘search…’ by default. And, when you put the mouse cursor on the textbox, the text is removed and then you can type your desired search text.
For this, two javascript event handler are used: onFocus and onBlur.

Javascript, jQuery, Magento »

[2 Mar 2011 | 8 Comments]

By default, Magento contains and uses the Prototype javascript library. You can also integrate the other most popular javascript library ‘jQuery‘ in your Magento site.
While integrating jQuery in Magento, you might get some javascript conflict and errors as you will be using two javascript libraries (prototype and jQuery) at a time. This is caused because prototype also uses ‘$‘ as a function or variable name, just as jQuery does.

Javascript »

[28 Jan 2011 | 3 Comments]

Here is a quick code to get the current URL of a page with Javascript:-
var current_url = location.href;
Here is another way:-

Javascript »

[25 Jan 2010 | 3 Comments]

It is very easy to execute some code after a specified time-interval, i.e. setting some time interval between the code. We can use the setTimeout function.
Here is the code: