Posts

Important books for Aspirants of IIT JEE

Image
Here is the complete list of books that can help you for the preparation of JEE Main & JEE Advanced. These books are available for both Class 11 and Class 12. Best maths books for the preparation of JEE Main And JEE advanced   Coordinate Geometry Textbook of  Integral Calculus  for JEE Main & Advanced  Author : Amit M Agarwal Textbook of  Algebra Vol.1  for JEE Main & Advanced Author : Dr. SK Goyal TA Textbook of  Vectors & 3D Geometry  for JEE Main & Advanced Author : Amit M Agarwal A Textbook of  Algebra  for JEE Main & Advanced, Author : Dr. S K Goyal Play with Graphs A Magical book to teach  Problem Solving through Graphs Author : Amit M A Textbook  of Trigonometry  for JEE Main & Advanced Author : Amit M Agarwal Selected Topics in Mathematics  Statics & Dynamics, Statics &  Numerical Methods & Volume & Surfaces Author : Dr. S K Goyal A Textbook of  Diff...

Detect an AJAX Request in PHP

I like using the same PHP script for both AJAX and non-AJAX content requests. Using one script just makes everything easier because it's only one file to update/edit and it's one more cache-able request. One way to try detect an AJAX request (as opposed to a regular page load) is by using the following PHP code: /* decide what the content should be up here .... */ $content = get_content ( ) ; //generic function; /* AJAX check */ if ( ! empty ( $_SERVER [ 'HTTP_X_REQUESTED_WITH' ] ) && strtolower ( $_SERVER [ 'HTTP_X_REQUESTED_WITH' ] ) == 'xmlhttprequest' ) { /* special ajax here */ die ( $content ) ; } /* not ajax, do more.... */ $_SERVER['HTTP_X_REQUESTED_WITH']  is the golden ticket but not all servers provide this variable so having other checks in place will be important.

CSS Click Event : Using CSS for Click Events

CSS doesn’t provide any official way to handle a click event in CSS. But there are some very interesting tricks that we can use to “detect” a click using CSS only, without a single line of JavaScript, and this is what we are going to talk about today. How ot Works ? The HTML 1 2 < input type = "checkbox" > < p class = "to-be-changed" >I'm going to be red! It's gonna be legen... Wait for it...</ p > The CSS 1 2 3 4 5 6 7 .to-be-changed {      color : black ; }   input[type=checkbox]:checked ~ .to-be-changed {      color : red ; } As you can see, it relies on the :checked pseudo-class and on the general sibling selector  ~ . Please note that it also works like a charm with the adjacent sibling selector  + . Basically, it says “if the checkbox is checked, then the following elements with the  .to-be-changed  class will be red”. Okay, a check...