Top 50 Php And Jquery Interview Questions
Q1. What Are Features Of Jquery Or What Can Be Done Using Jquery?
Features of Jquery:
One can effortlessly provide outcomes and can do animations.
Applying / Changing CSS.
Cool plugins.
Ajax help
DOM choice occasions
Event Handling.
Q2. What Is Cdn And How Jquery Is Related To It?
CDN - It stands for Content Distribution Network or Content Delivery Network.
Generally, a group of systems at diverse places related to trfer information files between them to increase its bandwidth while getting access to information. The standard architecture is designed in this sort of manner that a consumer get admission to a document reproduction from its nearest patron rather than gaining access to it from a centralized server.
So we can load this jQuery record from that CDN in order that the performance of all the customers running below that network can be accelerated.
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>
Q3. How Can We Apply Css In Last Child Of Parent Using Jquery Library?
$(”tr:closing”).Css(backgroundColor: ‘yellow’, fontWeight: ‘bolder’);
Q4. What Difference Between Require() And Require_once()?
Require()
The Require() is used to include a document, It create fatal mistakes if report now not observed and terminate script.
Require_once()
The require_once() to require() except PHP will check if the file has already been included, and if so, tricor online now not include (require) it again.
Q5. Check/uncheck An Input In Jquery?
Using two function, we will carry out the operation.
// Check #x $(“#checkboxid”).Attr(“checked”, “checked”); // Uncheck #x $(“#checkboxid”).RemoveAttr(“checked”);
Q6. What Are Selectors In Jquery Mean ?
Generally in HTML, if we need to paintings with any manipulate on a web web page we want to find the manipulate. For that we use file.GetElementByID or document.GetElementByName. But in jquery we do it the usage of Selectors.
Using this selectors we will select all the controls as well using a symbol (* )
A sample code snippet may be of this shape
<script language="javascript" type="text/javascript"> $("*").Css("border", "10px red"); </script>
Q7. Can We Select A Element Having A Specific Class In Jquery ?
Yes, we are able to select an detail with a particular magnificence, we use the elegance selector.The elegance call must contain the prefix as "." (dot).
<script language="javascript" type="text/javascript"> $(".Class1").Css("border", "2px strong red"); </script>
Q8. Mac, Windows Or Linux? Why Do You Love This Platform While Using Jquery?
I switched to Mac hardware round a 12 months ago and I’m totally in love with it. All components paintings together well, and thus far, I in no way needed to return my Mac ebook Pro to the Apple Store due to an trouble. However, I’m nonetheless using Windows through Parallels due to the fact OSX, while visually exceptional and solid, has fundamental usability flaws.
One of these flaws is the Finder. I these days labored at the jQuery UI Selectables within the labs model, and over again saw that the Finder had fantastic flaws while it comes all the way down to selection. For example, in case you choose more than one gadgets and click on one among them, the more than one selection isn’t cleared. Also, my equipment that I love for home windows surely don’t have an opportunity but .
Q9. What Does Dollar Sign ($) Me In Jquery?
Dollar Sign is not anything but it's an alias for JQuery. Take a study beneath jQuery code
$(report).Geared up(function() );
Over right here $ sign can be changed with "jQuery " keyword.
JQuery(file).Ready(characteristic() );
Q10. How To Use Jquery.Connect?
Download jquery.Join.Js record.
Encompass this file in your html record.
And use $.Join feature to connect a feature to any other characteristic.
Q11. Why Jquery?
JQuery is very compact and well written JavaScript code that increases the productivity of the developer by using permitting them to attain important UI functionality by writing very much less quantity of code.
It facilitates to
Improve the performance of the software
Develop most browser well suited web page
Implement UI associated important functionality without writing masses of strains of codes
Fast
Extensible – jQuery can be extended to implement custom designed behavior.
Other advantages of jQuery are
No want to learn fresh new syntax's to apply jQuery, understanding easy JavaScript syntax is enough.
Simple and Cleaner code, no want to write down numerous strains of codes to obtain complicated capability.
Q12. Explain The Features Of Jquery?
Features of jQuery are :
Effects and animations
Ajax
Extensibility
DOM element selections functions
Events
CSS manipulation
Utilities – together with browser version and the every function.
JavaScript Plugins
DOM traversal and modification.
Q13. Explain The Concepts Of "$ Function" In Jquery With An Example?
The type of a function is "feature".
There are quite a few nameless features is jquery.
$(record).Geared up(characteristic() ); $("a").Click on(function() ); $.Ajax( url: "someurl.Php", success: function() );
Q14. Do We Need To Add The Jquery File Both At The Master Page And Content Page As Well?
No, if the Jquery document has been added to the grasp page then we can get entry to the content page directly without adding any connection with it.
This may be finished using this easy example
<script type="text/javascript" src="jQuery-1.4.1-min.Js"></script>
Q15. Disable/allow An Element In Jquery?
// Disable #x $(“#x”).Attr(“disabled”,”disabled”); // Enable #x $(“#x”).RemoveAttr(“disabled”);
Q16. When Can You Use Jquery?
JQuery can be used to for growing ajax primarily based applications.
It can be used to maintain the code simple, concise and reusable.
It simplifies the procedure of traversal of HTML DOM tree.
It can also deal with occasions, perform animation, and upload the ajax assist in net applications.
Q17. What Is J-question?
JQuery is a mild weight JavaScript library which provides fast and easy manner of HTML DOM traversing and manipulation, its occasion handling, its patron facet animations, and so on. One of the best functions of jQuery is that jQuery supports an green manner to enforce AJAX applications due to its mild weight nature and make normalize and efficient web packages.
Q18. What Is Jquery Ui?
JQuery UI is a library that's constructed on top of JQuery library. JQuery UI comes with cool widgets, consequences and interplay mechanism.
Q19. Name Some Of The Methods Of Jquery Used To Provide Effects?
Some of the common methods are :
Show()
Hide()
Toggle()
FadeIn()
FadeOut().
Q20. What Is A Jquery ?
It’s very simple but maximum valuable Question on jQuery me jQuery is a quick and concise JavaScript Library that simplifies HTML record traversing, animating, event handling, and Ajax interactions for speedy net development. JQuery is designed to change the way which you write JavaScript. JQuery is build library for javascript no want to write down your personal features or script jQuery all prepared performed for you.
Q21. How We Can Apply Css In Multiple Selectors In Jquery?
Here to take effect is instance to illustrate
$(“div,span,p.MyClass”).Css(“border”,”1px strong green”);
the border will be observe in all div,span ,p.MyClass magnificence element.
Q22. How Is Body Onload() Function Is Different From Document.Ready() Function Used In Jquery?
Document.Geared up() feature is different from body onload() function due to the fact off 2 reasons.
We will have multiple record.Prepared() feature in a web page wherein we can have best one onload function.
Document.Equipped() function is known as as quickly as DOM is loaded where body.Onload() function is known as when everything receives loaded on the web page that consists of DOM, snap shots and all related assets of the page.
Q23. How Can You Select All Elements In A Page Using Jquery?
To choose all elements in a page, we are able to use all selectors, for that we need to use *(asterisk image).
<script language="javascript" type="text/javascript"> $("*").Css("border", "2px dotted purple"); </script>
Q24. Change The Url For A Hyperlink Using Jquery?
There are three manner to trade the URL for a Hyperlink the usage 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.Replace(/^http: / / beta.Wisdomjobs.Com/, "http://wisdomjobs.Com"); );
Q25. What Is The Advantage Of Using The Minified Version Of Jquery Rather Than Using The Conventional One?
The gain of the usage of a minified model of JQuery document is Efficiency of the internet page will increase.
The normal version jQuery-x.X.X.Js has a file size of 178KB but the minified model jQuery.X.X.X-min.Js has 76.7 KB.
The discount in length makes the page to load greater faster than you operate a traditional jQuery report with 178KB.
Q26. How Can We Calculate The Similarity Between Two Strings?
Using similar_text() get similarity among strings.
Return Values
Returns the wide variety of matching chars in each strings.
Instance
<?Php
$first =’php3′;
$first =’php4′;
echo retail price similar_text ( $first, $second ) //3
?>
Q27. Check Or Uncheck All Checkboxes Using Jquery?
There are special strategies to check and uncheck the check containers.
Think that 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″ />
using attr() characteristic. $(‘#checkall’).Click(function() $(“enter[@name='Items']:checked”).Attr(‘checked’,proper); ); $(‘#uncheckall’).Click(function() $(“enter[@name='Items']:checked”).Attr(‘checked’,false););
using attr() and removeAttr()funstions $(‘#checkall’).Click(feature() $(“enter[@name='Items']:checked”).Attr(‘checked’,actual); ) $(‘#uncheckall’).Click(characteristic() $(“input[@name='Items']:checked”).RemoveAttr(‘checked’);)
Q28. Different Ways Of Using $.Connect Function In Jquery?
The syntax of connect characteristic is
$.Connect(sourceObj/*object*/, sourceFunc/*string*/, callObj/*object*/, callFunc/*string or Func*/)
sourceObj(optionally available) is the item of the supply function to which we want to attach.
SourceFunc is the feature call to which we need to attach.
CallObj(elective) is the item which we need to use for the handler characteristic.
CallFunc is the function that we need to execute when sourceFunc is executed.
Here sourceObj, callObj are non-obligatory for the worldwide features.
Suppose if your sourceFunc is global function then no want to bypass the sourceObj or you could use null or self.
Think in case your callObj is global feature then no want to pass the callObj or you may use null or self.
Q29. What Are The Advantages Of Jquery ?
There are many blessings with JQuery. Some of them are :
It is more like a JavaScript enhancement so there may be no overhead in learning a brand new syntax.
It has the capacity to preserve the code easy, readable, clear and reusable.
It would eliminate the requirement for writing complicated loops and DOM scripting library calls.
Q30. How To Use Jquery?
JQuery can be easily used with different libraries so it have to work out of the field with simple and complex JavaScript and Ajax.
Q31. What Is Jquery Connect?
It is a jquery plugin which allows us to connect a characteristic to every other characteristic. It is like assigning a handler for some other characteristic. This situation occurs while you are using any javascript plugins and you need to execute some function whilst ever a few characteristic is done from the plugin. This we will clear up the usage of jquery connect feature.
Q32. In Php How Can You Jump In To And Out Of "personal home page Mode"?
The Php code is enclosed in special Start < ? And end ? > tags that allow ingredients you to jump in to and out of “php mode”.
Q33. How Can We Apply Css In Div Using Jquery?
The use of css() approach we can apply css in div detail.
Instance:
$(“div”).Css(“border”,”1px stable inexperienced”);
Q34. How Can We Apply Css In Odd Childs Of Parent Node Using Jquery Library?
$(”tr:atypical”).Css(”background-colour”, “#bbbbff”);
Q35. How Can We Apply Css In Even Childs Of Parent Node Using Jquery Library?
$(”tr:even”).Css(”history-colour”, “#bbbbff”);
Q36. Explain How Jquery Works?
<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>
Q37. How To Use Jquery Library In Our Asp.Net Project?
Download the latest jQuery library from jQuery.Com and encompass the connection with the jQuery library record in our ASPX web page.
<script src="_scripts/jQuery-1.2.6.Js" type="text/javascript"></script>
<script language="javascript"> $(file).Ready(characteristic() alert('check'); ); </script>
Q38. Fetch The Values Of Selected Checkbox Array Using Jquery?
Suppose that below 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 need the get the fee of selected checkbox the usage of jquery.
Then easy use under code.
Var selItems = new Array();
$(input[@name='Items[]‘]:checked”).Every(characteristic() selItems .Push($(this).Val()););
Here selItems will take all decided on fee of checkbox.
Q39. Why Is Jquery Better Than Javascript?
JQuery is remarkable library for growing ajax based utility.
It facilitates the programmers to keep code easy and concise and reusable.
JQuery library simplifies the method of traversal of HTML DOM tree.
JQuery also can manage occasions, carry out animation, and add the Ajax aid in internet applications.
Q40. How Can I Execute A Php Script Using Command Line?
Just run the PHP CLI (Command Line Interface) application and provide the PHP script record call as the command line argument. For example, “personal home page myScript.Hypertext Preprocessor”, assuming “php” is the command to invoke the CLI application. Be conscious that in case your PHP script changed into written for the Web CGI interface, it is able to not execute nicely in command line surroundings.
Q41. What Are The Advantages Of Jquery?
The advantages of the usage of jQuery are:
JavaScript enhancement with out the overhead of gaining knowledge of new syntax.
Ability to preserve the code easy, clear, readable and reusable.
Eradication of the requirement of writing repetitious and complicated loops and DOM scripting library calls.
Q42. Which Version Of Jquery File Should Be Used?
In maximum of the latest releases thus far, the center capability of jQuery stays equal but a few extra cool and better capabilities are delivered. Ideally you need to use the modern jQuery documents available. By doing this you ensure that your in advance functionality will nonetheless paintings and you can use new capabilities available as part of the new launch.
Q43. What Is The Name Of Jquery Method Used For An Asynchronous Http Request?
JQuery.Ajax().
Q44. What Are The Different Type Of Selectors In Jquery?
There are three forms of selectors in Jquery
CSS Selector
XPath Selector
Custom Selector.
Q45. Return Ascii Value Of Character In Php?
The usage of ord() approach we can get ASCII fee of individual in Hypertext Preprocessor.
<?Php $str = "n" style="color: #007700;">; if (ord fashion="shade: #0000bb;">$str) == 10) echo "The first individual of $str is a line feed.N"; ?>
Q46. How We Can Modify The Css Class In Jquery?
Using css technique we are able to regulate elegance using jquery
example:$(“.CssClass1.CssClass2″).Css(“border”,”1px solid green”);
CssClass1,CssClass2 might be alter to frame 1px stable inexperienced.
Q47. What Does A Special Set Of Tags Do In Php?
The tags <?= and ?> displayed output immediately to the web browser.
Q48. What Is The Use Of Delegate() Method In Jquery?
The delegate() technique can be used in methods.
1) If you have a figure detail, and you want to attach an occasion to every one in every of its infant factors, this delegate() approach is used.
Ex:Un-ordered
2) When an detail isn't always to be had at the contemporary page, this approach is used.
.Live() approach is likewise used for the identical cause however, delegate() approach is a piece quicker.
Q49. Get The Value Of Selected Option In Jquery?
<select id="sel"> <option value="1">Hi</option> <option value="2">Hello</option> <option value="3">Helloooooo</option> <option value="4">good enough</option> <option value="5">Okey</option> </select>
want to get the cost of decided on option, then use
$("select#sel").Val();
or textual content of decided on field, then use
$("#seloption:selected").Text();
Q50. What Distinguishes Php From Something Like Client Side Java Script?
Java script implemented on purchaser aspect even as in php code carried out on server opinions aspect.

