JQuery Developer

  Home  Client Side Scripting  JQuery Developer


“JQuery Developer related Frequently Asked Questions by expert members with experience in JQuery Developer. These questions and answers will help you strengthen your technical skills, prepare for the new job test and quickly revise the concepts”



51 JQuery Developer Questions And Answers

45⟩ How to get server response from an AJAX request using Jquery?

When invoking functions that have asynchronous behavior We must provide a callback function to capture the desired result. This is especially important with AJAX in the browser because when a remote request is made, it is indeterminate when the response will be received.

Below an example of making an AJAX call and alerting the response (or error):

Code:

$.ajax({

url: 'pcdsEmpRecords.php',

success: function(response) {

alert(response);

},

error: function(xhr) {

alert('Error! Status = ' + xhr.status);

}

});

 157 views

46⟩ Why we need jQuery?

jQuery is needed for:

★ Used to develop browser compatible web applications.

★ Improve the performance of an application.

★ Very fast and extensible.

★ UI related functions are written in minimal lines of codes

 142 views

49⟩ If you have a server control(asp.net server control, Button) and on the click of button you want to call a jquery function, So tell me how you will call a jquery function without postback?

ASP.NET provides the OnClientClick property to handle button clicks. You can use this property on Button, LinkButton and ImageButton. The same OnClientClick property also allows you to cancel a postback.

So I can use OnClientClick property and Jquery function will return false.

Example:

Code:

<script type="text/javascript">

function callMe()

{

alert('Hello');

return false;

}

</script>

<asp:Button ID="Button1" runat="server" OnClientClick="return callMe();" Text="Button" />

 115 views

50⟩ Can you please explain the difference between jQuery's ready and holdReady?

jQuery's ready is an event which gets triggered automatically when DOM is ready while holdReady is a signal/flag to hold this triggering. holdReady was included in 1.6 version and it works only if used before the execution/triggering of ready event. Once ready event is fired, it has nothing to do. It is useful in dynamically loading scripts before the ready starts. It release ready event execution when used with a true parameter.

 141 views

51⟩ When can JQuery be used?

JQuery can be used to perform:

1) Call methods on specific events

2) Traverse the documents

3) For apply CSS

4) Manipulation purpose and

5) To add effects too.

6) For apply animations

7) For give atractive look (dialogbox etc)

8) For asynchronous calls ($.ajax())

 134 views