YouTube Icon

Interview Questions.

Top 100+ Php And Jquery Interview Questions And Answers - Jun 01, 2020

fluid

Top 100+ Php And Jquery Interview Questions And Answers

Question 1. What Is J-question?

Answer :

JQuery is a mild weight JavaScript library which gives fast and clean way of HTML DOM traversing and manipulation, its event dealing with, its patron facet animations, and so on. One of the best capabilities of jQuery is that jQuery helps an green manner to enforce AJAX programs due to its light weight nature and make normalize and green internet applications.

Question 2. How To Use Jquery?

Answer :

jQuery can be easily used with different libraries so it need to workout of the field with simple and complicated JavaScript and Ajax.

PHP Interview Questions
Question three. What Distinguishes Php From Something Like Client Side Java Script?

Answer :

Java script carried out on purchaser aspect whilst in php code done on server evaluations aspect.

Question four. In Php How Can You Jump In To And Out Of "Hypertext Preprocessor Mode"?

Answer :

The Php code is enclosed in unique Start < ? And end ? > tags that allow ingredients you to jump in to and out of “Hypertext Preprocessor mode”.

PHP Tutorial
Question 5. How To Use Jquery Library In Our Asp.Net Project?

Answer :

Download the contemporary jQuery library from jQuery.Com and encompass the connection with the jQuery library file in our ASPX page.

  <script  src="_scripts/jQuery-1.2.6.Js" type="text/javascript"></script>
  <script language="javascript">
    $(document).Prepared(function() 
  alert('take a look at');
  );
  </script> 
Zend Interview Questions
Question 6. What Is Jquery Connect?

Answer :

It is a jquery plugin which allows us to attach a function to another feature. It is like assigning a handler for every other function. This state of affairs takes place when you are using any javascript plugins and also you need to execute some feature while ever some characteristic is done from the plugin. This we will resolve the use of jquery join feature.

Question 7. How To Use Jquery.Join?

Answer :

down load jquery.Join.Js record.
Encompass this report for your html report.
And use $.Connect feature to attach a function to some other feature.
Zend Tutorial PHP+MySQL Interview Questions
Question 8. Different Ways Of Using $.Join Function In Jquery?

Answer :

The syntax of connect function is
$.Connect(sourceObj/*item*/, sourceFunc/*string*/, callObj/*item*/, callFunc/*string or Func*/)

sourceObj(elective) is the object of the source characteristic to which we want to connect.
SourceFunc is the feature call to which we want to attach.
CallObj(optional) is the object which we need to use for the handler function.
CallFunc is the characteristic that we want to execute while sourceFunc is completed.
Here sourceObj, callObj are elective for the worldwide features.
Assume in case your sourceFunc is worldwide function then no need to pass the sourceObj or you may use null or self.
Suppose in case your callObj is global characteristic then no need to pass the callObj or you can use null or self.

Question 9. Explain The Concepts Of "$ Function" In Jquery With An Example?

Answer :

The form of a characteristic is "function".
There are quite a few nameless functions is jquery.

$(record).Geared up(characteristic() );
$("a").Click on(feature() );

$.Ajax(
url: "someurl.Hypertext Preprocessor",
fulfillment: function() 
); 
Sybase Interview Questions
Question 10. Why Is Jquery Better Than Javascript?

Answer :

jQuery is first rate library for growing ajax based application.
It allows the programmers to hold code easy and concise and reusable.
JQuery library simplifies the process of traversal of HTML DOM tree.
JQuery also can deal with occasions, carry out animation, and upload the Ajax help in net packages.
Magento Tutorial
Question eleven. Explain How Jquery Works?

Answer :

  <html>
  <head>
  <script type="text/javascript"  src="jquery.Js"></script>
  <script type="text/javascript">
  // You can write the code right here 
  </script>
  </head>
  <body>
  <a  href="http://www.Wisdomjobs.Com/">WisdomJobs</a>
  </body>
  </html> 
Dbase Interview Questions
Question 12. When Can You Use Jquery?

Answer :

jQuery may be used to for growing ajax based totally packages.
It can be used to maintain the code easy, concise and reusable.
It simplifies the method of traversal of HTML DOM tree.
It can also deal with activities, carry out animation, and upload the ajax assist in web applications.
PHP Interview Questions
Question 13. What Is A Jquery ?

Answer :

It’s very simple but maximum valuable Question on jQuery means jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, animating, occasion dealing with, and Ajax interactions for speedy net development. JQuery is designed to trade the way that you write JavaScript. JQuery is construct library for javascript no need to write your very own functions or script jQuery all geared up carried out for you.

WordPress Tutorial
Question 14. Change The Url For A Hyperlink Using Jquery?

Answer :

There are 3 way to alternate the URL for a Hyperlink the use of jQuery.

$("a").Attr("href", "http://www.Wisdomjobs.Com/");
$("a[href='http://www.Wisdomjobs.Com/']") .Attr('href', 'http://wisdomjobs.Com/');
$("a[href^='http://wisdomjobs.Com']").Each(characteristic() this.Href = this.Href.Update(/^http: / /  beta.Wisdomjobs.Com/, "http://wisdomjobs.Com"); );
Question 15. Check Or Uncheck All Checkboxes Using Jquery?

Answer :

There are one of a kind strategies to check and uncheck the take a look at boxes.
Assume which you have checkboxes like that

<input type=”checkbox” value=”1″ name=”Items” id=”Items1″ />
<input type=”checkbox” value=”2″ name=”Items” id=”Items2″ />
<input type=”checkbox” value=”3″ name=”Items” id=”Items3″ />
<input type=”checkbox” value=”4″ name=”Items” id=”Items4″ />

the usage of attr() feature.
$(‘#checkall’).Click(feature()
$(“input[@name='Items']:checked”).Attr(‘checked’,true);
);
$(‘#uncheckall’).Click on(function()
$(“input[@name='Items']:checked”).Attr(‘checked’,false););
the use of attr() and removeAttr()funstions
$(‘#checkall’).Click on(feature()
$(“input[@name='Items']:checked”).Attr(‘checked’,actual);
)
$(‘#uncheckall’).Click(feature()
$(“enter[@name='Items']:checked”).RemoveAttr(‘checked’);)
Magento Interview Questions
Question 16. Fetch The Values Of Selected Checkbox Array Using Jquery?

Answer :

Suppose that underneath is checkbox array
<input type=”checkbox” value=”1″ name=”Items[]“ id=”Items1″ />
<input type=”checkbox” value=”2″ name=”Items[]“ id=”Items2″ />
<input type=”checkbox” value=”3″ name=”Items[]“ id=”Items3″ />
<input type=”checkbox” value=”1″ name=”Items[]“ id=”Items4″ />
and we want the get the value of decided on checkbox using jquery.
Then simple use beneath code.
Var selItems = new Array();
$(enter[@name='Items[]‘]:checked”).Every(feature() selItems .Push($(this).Val()););
Here selItems will take all decided on price of checkbox.

CakePHP Tutorial
Question 17. How We Can Apply Css In Multiple Selectors In Jquery?

Answer :

Here to take impact is example to illustrate
$(“div,span,p.MyClass”).Css(“border”,”1px strong green”);
the border may be follow in all div,span ,p.MyClass elegance detail.

PHP5 Interview Questions
Question 18. How We Can Modify The Css Class In Jquery?

Answer :

Using css technique we can regulate magnificence the use of jquery
instance:$(“.CssClass1.CssClass2″).Css(“border”,”1px strong inexperienced”);
CssClass1,CssClass2 will be modify to border 1px solid inexperienced.

Zend Interview Questions
Question 19. How Can We Apply Css In Div Using Jquery?

Answer :

the usage of css() technique we will apply css in div element.
Instance:
$(“div”).Css(“border”,”1px solid inexperienced”);

CodeIgniter Tutorial
Question 20. Get The Value Of Selected Option In Jquery?

Answer :

  <select id="sel">
  <option value="1">Hi</option>
  <option value="2">Hello</option>
  <option value="3">Helloooooo</option>
  <option value="4">adequate</option>
  <option value="5">Okey</option>
  </select>
need to get  the  price of decided on option, then use

   $("select#sel").Val();
or text of decided on container, then use

$("#seloption:decided on").Textual content();
WordPress Interview Questions
Question 21. Check/uncheck An Input In Jquery?

Answer :

Using  characteristic, we can carry out the operation.

// Check #x
$(“#checkboxid”).Attr(“checked”, “checked”);
// Uncheck #x
$(“#checkboxid”).RemoveAttr(“checked”);
Question 22. Disable/enable An Element In Jquery?

Answer :

// Disable #x
$(“#x”).Attr(“disabled”,”disabled”);
// Enable #x
$(“#x”).RemoveAttr(“disabled”);
Firebase Tutorial
Question 23. What Are The Advantages Of Jquery?

Answer :

The benefits of the use of jQuery are:

JavaScript enhancement with out the overhead of gaining knowledge of new syntax.
Ability to keep the code easy, clear, readable and reusable.
Eradication of the requirement of writing repetitious and complex loops and DOM scripting library calls.
CakePHP Interview Questions
Question 24. Explain The Features Of Jquery?

Answer :

Features of jQuery are :

Effects and animations
Ajax
Extensibility
DOM element alternatives features
Events
CSS manipulation
Utilities – including browser version and the each characteristic.
JavaScript Plugins
DOM traversal and amendment.
PHP+MySQL Interview Questions
Question 25. How Can We Apply Css In Odd Childs Of Parent Node Using Jquery Library?

Answer :

$(”tr:peculiar”).Css(”historical past-coloration”, “#bbbbff”);

PHP7 Tutorial
Question 26. How Can We Apply Css In Even Childs Of Parent Node Using Jquery Library?

Answer :

$(”tr:even”).Css(”history-color”, “#bbbbff”);

CodeIgniter Interview Questions
Question 27. How Can We Apply Css In Last Child Of Parent Using Jquery Library?

Answer :

$(”tr:closing”).Css(backgroundColor: ‘yellow’, fontWeight: ‘bolder’);

Sybase Interview Questions
Question 28. What Does A Special Set Of Tags Do In Php?

Answer :

The tags <?= and ?>  displayed  output without delay to the internet  browser.

Question 29. How Can We Calculate The Similarity Between Two Strings?

Answer :

Using similar_text() get similarity among two strings.

Return Values

Returns the quantity of matching chars in each strings.
Example

 <?Php
  $first =’php3′;
  $first =’php4′;
  echo  retail price similar_text ( $first, $second )  //3
  ?>
Firebase Interview Questions
Question 30. Return Ascii Value Of Character In Php?

Answer :

the usage of ord() technique we are able to get ASCII cost of character in personal home page.

 <?Php
  $str = "n" style="color:  #007700;">;
  if (ord style="color: #0000bb;">$str) == 10) 
  echo "The first individual of $str is a line feed.N";
  
  ?> 
Question 31. How Can I Execute A Php Script Using Command Line?

Answer :

Just run the PHP CLI (Command Line Interface) application and provide the PHP script file call because the command line argument. For instance, “Hypertext Preprocessor myScript.Php”, assuming “php” is the command to invoke the CLI software. Be conscious that in case your PHP script changed into written for the Web CGI interface, it could no longer execute well in command line surroundings.

Question 32. What Difference Between Require() And Require_once()?

Answer :

Require()
The Require() is used to consist of a file, It create deadly errors if document now not discovered and terminate script.

Require_once()
The require_once() to require() besides PHP will check if the document has already been blanketed, and if so, tricor online not consist of (require) it once more.

SQLite Interview Questions
Question 33. What Does Dollar Sign ($) Means In Jquery?

Answer :

Dollar Sign is not anything but it's an alias for JQuery. Take a take a look at under jQuery code

$(report).Geared up(feature()
);
Over right here $ signal may be changed with "jQuery " key-word.

JQuery(report).Ready(feature()
);
Dbase Interview Questions
Question 34. Mac, Windows Or Linux? Why Do You Love This Platform While Using Jquery?

Answer :

I switched to Mac hardware round a 12 months in the past and I’m completely in love with it. All components work collectively properly, and up to now, I by no means had to go back my Mac book Pro to the Apple Store due to an problem. However, I’m nevertheless using Windows through Parallels because OSX, whilst visually exceptional and solid, has fundamental usability flaws.
One of these flaws is the Finder. I lately labored at the jQuery UI Selectables within the labs version, and once again noticed that the Finder had amazing flaws while it comes all the way down to choice. For example, in case you pick more than one gadgets and click on on one among them, the a couple of choice isn’t cleared. Also, my gear that I love for home windows truly don’t have an opportunity but .

Question 35. How Is Body Onload() Function Is Different From Document.Prepared() Function Used In Jquery?

Answer :

Document.Geared up() characteristic isn't like body onload() feature because off 2 motives.

We will have more than one document.Prepared() feature in a page in which we are able to have most effective one onload characteristic.
Document.Prepared() function is referred to as as soon as DOM is loaded where body.Onload() feature is referred to as whilst the whole thing gets loaded on the page that consists of DOM, snap shots and all associated assets of the web page.
Question 36. What Is Jquery Ui?

Answer :

JQuery UI is a library which is built on pinnacle of JQuery library. JQuery UI comes with cool widgets, results and interaction mechanism.

Magento Interview Questions
Question 37. Name Some Of The Methods Of Jquery Used To Provide Effects?

Answer :

Some of the common strategies are :

Show()
Hide()
Toggle()
FadeIn()
FadeOut().
Question 38. What Are The Different Type Of Selectors In Jquery?

Answer :

There are 3 sorts of selectors in Jquery

CSS Selector
XPath Selector
Custom Selector.
Question 39. How Can You Select All Elements In A Page Using Jquery?

Answer :

To choose all factors in a page, we will use all selectors, for that we want to use *(asterisk image).


  <script  language="javascript" type="text/javascript">
    $("*").Css("border",  "2px dotted red"); 
  </script> 
Question 40. Which Version Of Jquery File Should Be Used?

Answer :

In most of the current releases to this point, the middle functionality of jQuery stays equal but a few extra cool and better capabilities are introduced. Ideally you must use the latest jQuery documents available. By doing this you ensure that your earlier capability will nonetheless paintings and you can use new capabilities available as part of the brand new launch.

PHP5 Interview Questions
Question forty one. What Are Selectors In Jquery Mean ?

Answer :

Generally in HTML, if we want to paintings with any manage on an internet web page we want to discover the manage. For that we use document.GetElementByID or record.GetElementByName. But in jquery we do it the use of Selectors.
Using this selectors we can select all of the controls as well using a image (* )
A sample code snippet may be of this shape

<script language="javascript" type="text/javascript">
$("*").Css("border", "10px crimson");
</script>
Question 42. Do We Need To Add The Jquery File Both At The Master Page And Content Page As Well?

Answer :

No, if the Jquery document has been brought to the master page then we can get admission to the content material page immediately without including any connection with it.
This can be finished the use of this easy instance
<script type="text/javascript" src="jQuery-1.4.1-min.Js"></script>

WordPress Interview Questions
Question forty three. What Is The Advantage Of Using The Minified Version Of Jquery Rather Than Using The Conventional One?

Answer :

The gain of the usage of a minified version of JQuery file is Efficiency of the internet page increases.
The everyday model jQuery-x.X.X.Js has a document length of 178KB but the minified version jQuery.X.X.X-min.Js has 76.7 KB.
The reduction in length makes the web page to load more quicker than you use a traditional jQuery record with 178KB.
Question 44. What Is Cdn And How Jquery Is Related To It?

Answer :

CDN - It stands for Content Distribution Network or Content Delivery Network.
Generally, a set of systems at numerous locations related to switch statistics documents among them to boom its bandwidth while gaining access to facts. The typical structure is designed in such a way that a customer get right of entry to a report copy from its nearest purchaser rather than accessing it from a centralized server.
So we will load this jQuery record from that CDN in order that the efficiency of all of the clients working underneath that community might be extended.
Example :
We can load jQuery from Google libraries API
<script type="text/javascript" language="Javascript"
src="https://ajax.Googleapis.Com/ajax/libs/jquery/1.4.4/jquery.Min.Js"></script>

Question 45. Can We Select A Element Having A Specific Class In Jquery ?

Answer :

Yes, we are able to choose an detail with a particular magnificence, we use the elegance selector.The elegance call must comprise the prefix as "." (dot).

<script language="javascript" type="text/javascript">
$(".Class1").Css("border", "2px stable purple");
</script>
Question forty six. What Are Features Of Jquery Or What Can Be Done Using Jquery?

Answer :

Features of Jquery:

One can easily provide outcomes and can do animations.
Applying / Changing CSS.
Cool plugins.
Ajax assist
DOM choice activities
Event Handling.
Question 47. What Are The Advantages Of Jquery ?

Answer :

There are many benefits with JQuery. Some of them are :

It is extra like a JavaScript enhancement so there may be no overhead in learning a brand new syntax.
It has the potential to preserve the code simple, readable, clean and reusable.
It would remove the requirement for writing complex loops and DOM scripting library calls.
Question 48. Why Jquery?

Answer :

jQuery may be very compact and properly written JavaScript code that increases the productivity of the developer through allowing them to acquire critical UI capability through writing very less quantity of code.
It helps to

Improve the overall performance of the software
Develop maximum browser like minded web web page
Implement UI associated essential functionality with out writing masses of strains of codes
Fast
Extensible – jQuery can be prolonged to implement custom designed conduct.
Other advantages of jQuery are

No want to research clean new syntax's to apply jQuery, knowing simple JavaScript syntax is sufficient.
Simple and Cleaner code, no need to jot down several traces of codes to acquire complicated functionality.
Question forty nine. What Is The Use Of Delegate() Method In Jquery?

Answer :

The delegate() approach may be used in two methods.
1) If you've got a figure element, and also you want to attach an occasion to each one of its infant elements, this delegate() approach is used.
Ex:Un-ordered
2) When an element isn't to be had at the modern web page, this method is used.
.Live() technique is likewise used for the same purpose however, delegate() method is a chunk quicker.

Question 50. What Is The Name Of Jquery Method Used For An Asynchronous Http Request?

Answer :

jQuery.Ajax().




CFG