Tag Archives: jquery

Jquery: Detect any change in form before submission

Hello friends, Here, we are going to detect any change in the form content before form submission. Hence, there is no meaning of submitting a form without any content change. Let’s start. Step 1: Create a java-script file(detect-form-change.js) having the logic to detect the change in form.

Step 2: Implementation of logic on forms… Read More »

Javascript: Advantages and Disadvantages of Ajax

Hello friends, Here we shall discuss about some advantages and disadvantages of using AJAX. Advantages of ajax: #1) Almost supports all modern browsers #2) Reduce the traffic travels between the client and the server. #3) Response time is faster so increases performance and speed. #4) Many open source javaScript libraries available for ajax support like… Read More »

Jquery: Detect Browser

Sometimes you need to determine the browser type of the browser currently in use. You can use the following piece of code to do this:

You can also check for the browser version like below:

That’s all!

Jquery: Disable/Enable Right Mouse Click

If you are using Jquery and you want to disable right click on your web browser, you can use the following piece of code:

To enable right click again, use the below code:

That’s all!

Zend Framework 2 : Perform ajax request

Step 1 : Include jquery.js file in layout.phtml Step 2 : Create Contorller JavascriptController.php in /path/to/yourapp/module/Application/src/Application/Controller/

Step 3 : Create a javascript file ajax.js in /public/js/modules/javascript/ajax.js

Step 4 : Create index.phtml in /path/to/yourapp/module/Application/view/application/jsvascript/index.phtml

Step 5 : Finally, in /path/to/yourapp/module/Application/comfig/module.config.php file add following code in [view_manager] to support ajax requests

Javascript : Compare two dates