jquery quetions

What is the purpose of ‘this’ operator in JavaScript?

JavaScript famous keyword this always refers to the current context.

Global Variables − A global variable has global scope which means it is visible everywhere in your JavaScript code.

Local Variables − A local variable will be visible only within a function where it is defined. Function parameters are always local to that function.

Which type of variable among global and local, takes precedence over other if names are same?

A local variable takes precedence over a global variable with the same name.


pop() : built-in method removes the last element from an array and returns that element
length() : built-in method returns the length of the string

reverse() :  built-in method reverses the order of the elements of an array
sort() : built-in method sorts the elements of an array
substr() : built-in method returns the characters in a string beginning at the specified location
toLowerCase() : built-in method returns the calling string value converted to lower case

select multiple elements using jQuery?

$(‘E, F, G’)


attributes of an element using jQuery?

The attr()

set attributes of an element using jQuery?

The attr(name, value)


How can you apply a style on an element using jQuery?

The addClass( classes )


remove an attribute from each of the matched elements using jQuery?

The removeAttr( name )
specified class is present on at least one of the set of matched elements using jQuery?

The hasClass( class )

specified class if it is not present, remove the specified class if it is present using jQuery?

The toggleClass(class)

Question : What is selectors? How many selectors are in jquery?

Check this link : https://www.w3schools.com/jquery/jquery_ref_selectors.asp

checks the current selection against an expression using jQuery?

The is( selector )

select a subset of the matched elements using jQuery?

The slice(selector)

add more elements, matched by the given selector, to the set of matched elements using jQuery?

The add( selector )


The .detach() and .remove() methods are the same, except that .detach() retains all jQuery data associated with the removed elements and .remove() does not. .detach() is therefore useful when removed elements may need to be reinserted into the DOM at a later time

.empty(): This method removes all the child element of the matched element where remove() method removes set of matched elements from DOM.

.remove(): This method takes elements out of the DOM. Use .remove() when you want to remove the element itself, as well as everything inside it. In addition to the elements themselves, all bound events and jQuery data associated with the elements are removed


append() : jQuery object to insert at the end of each element in the set of matched elements.

<div class="container">
<div class="inner">
<div class="inner">
You can also select an element on the page and insert it into another:

Example :    $( ".container" ).append( $( "h2" ) );

Output :

<div class="container">
<div class="inner">Hello</div>
<div class="inner">Goodbye</div>

php.ini file quetions

  1.  Five function of PHP.ini file?
  2. Maximum limit of all paramitters which we can set in php.ini file?


SOME basic functions of php.ini file :

; File Uploads ;

; Whether to allow HTTP file uploads.
; http://php.net/file-uploads
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
; http://php.net/upload-tmp-dir
upload_tmp_dir = “C:\xampp\tmp”

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 2M

; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20


; Windows Extensions
set dill files

Be sure to appropriately set the extension_dir directive.

; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Europe/Berlin


; Default port number for mysql_connect().  If unset, mysql_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order).  Win32 will only look
; http://php.net/mysql.default-port
mysql.default_port = 3306


short_open_tag = Off

Short open tags look like this: <? ?>. This option must be set to Off if you want to use


XML functions.


max_execution_time = 30

The function set_time_limit() won.t work in safe mode, so this is the main way to make a script time out in safe mode. In Windows, you have to abort based on maximum memory consumed rather than time. You can also use the Apache timeout setting to timeout if you use Apache, but that will apply to non-PHP files on the site too.


error_reporting = E_ALL & ~E_NOTICE

The default value is E_ALL & ~E_NOTICE, all errors except notices. Development servers should be set to at least the default; only production servers should even consider a lesser value


auto-prepend-file = [path/to/file]

If a path is specified here, PHP must automatically include() it at the beginning of every PHP file. Include path restrictions do apply.
auto-append-file = [path/to/file]

If a path is specified here, PHP must automatically include() it at the end of every PHP file.unless you escape by using the exit() function. Include path restrictions do apply.


mysql.default_host = hostname

The default server host to use when connecting to the database server if no other host is specified.
mysql.default_user = username

The default user name to use when connecting to the database server if no other name is specified.
mysql.default_password = password

The default password to use when connecting to the database server if no other password is specified.

htaccess questions


400 – Bad request
401 – Authorization Required
403 – Forbidden
404 – File Not Found
500 – Internal Server Error

ErrorDocument 404 /filenotfound.html

DirectoryIndex index.php3 index.php pictures.pl index.html default.htm

The use of .htaccess files can be disabled completely by setting the AllowOverride directive to none:

AllowOverride None

mod_rewrite directives must go in .htaccess files.



RewriteEngine On
RewriteOptions Inherit


cache files

# 1 Month for most static assets
<filesMatch “.(css|jpg|jpeg|png|gif|js|ico)$”>
Header set Cache-Control “max-age=2592000, public”

max-age=2592000 (in secounds  2592000 1 month)