JavaScript jQuery Tips and Tricks for Programmers

Today, We want to share with you JavaScript jQuery Tips and Tricks for Programmers.In this post we will show you Top 8 jQuery Tips and Tricks, hear for 8 awesome JQuery tips and tricks we will give you demo and example for implement.In this post, we will learn about 8 Top jQuery Tips & Tricks for jQuery Programmers with an example.

JavaScript jQuery Tips and Tricks for Programmers

There are the Following The simple About JavaScript jQuery Tips and Tricks for Programmers Full Information With Example and source code.

As I will cover this Post with live Working example to develop advanced jquery interview questions, so the some jquery tutorial advanced for this example is following below.

jQuery Tips No : #1

Check if an Element Exists

if ($("#myHTMLElements_Name").length)
{ 
//The HTML DOM Your element exists check Conditions
}
else
{
//The HTML DOM Your element doesn't exist
}

jQuery Tips No : #2

jQuery Set a Timer

function myfunname(){
  alert("Welcome To Pakainfo.com!");
}
setTimeout(myfunname, 3000);

//Or an anonymous function:

setTimeout(function(){
  alert("Welcome To Pakainfo.com!");
}, 2000);

jQuery Tips No : #3

The jQuery Selector Property

$('#main-part li:first-child').selector    // #main-part li:first-child
$('#main-part li').filter(':first-child').selector    // #main-part li.filter(:first-child)

jQuery Tips No : #4

Make an Empty jQuery Object

var container = $([]);
container.add(another_HTML_element_name);

jQuery Tips No : #5

Determine the Weight of Your Web Page

console.log( $('*').length );

jQuery Tips No : #6

jQuery Set Global AJAX Defaults

// server side request ajaxSetup is useful for config setting general main defaults:
$.ajaxSetup({
    url         : 'api/ajax/page.php',
    dataType    : 'json'
});

$.ajaxStart(function(){
    showIndicator();
    disableButtons();
});

$.ajaxComplete(function(){
	//for hide
    hideIndicator();
	//for enableButtons
    enableButtons();
});

/*
    // more extra Additional some methods you can use like:
    $.ajaxStop();
    $.ajaxError();
    $.ajaxSuccess();
    $.ajaxSend();
*/

jQuery Tips No : #7

Disabling Right Mouse Click using jQuery

//jQuery Disabling Right Mouse Click
$(document).ready(function(){
	$(document).bind("contextmenu",function(e){
		return false;
	});
});

jQuery Tips No : #8

jQuery Get Detect Current Mouse Coordinates

$(document).ready(function() {
	$().mousemove(function(e)
	{
	$('# detectposition ').html("Your Live X Axis perfect Position = " + e.pageX + " and also Live Y Axis perfect Position = " + e.pageY);
	});
	
});
Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about JavaScript jQuery Tips and Tricks for Programmers.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Comment