MOST IMPORTANT JQUERY UI INTERVIEW QUESTIONS

MOST IMPORTANT JQUERY UI INTERVIEW QUESTIONS

Question 1. What Is Jquery Ui?
Answer :
It is JavaScript Library which is collection of jQuery widgets like datepicker, tabs, autocomplete etc. We can also add effects, interactions (drag, drop, resize) on widgets.

Question 2. What Widets Are Available In Jquery Ui?
Answer :

Accordion

Autocomplete

Button

Datepicker

Dialog

Menu

Progressbar

Selectmenu

Slider

Spinner

Tabs

Tooltip


Question 3. What Are Different Effects Available In Jquery Ui?
Answer :

Add Class

Color Animation

Easing

Effect

Hide

Remove Class

Show

Switch Class

Toggle

Toggle Class

Question 4. In Which Language, Jquery Ui Is Written?
Answer :
JavaScript


Question 5. Is Jquery Ui Opensource?
Answer :
Yes.

Question 6. What Is Current Stable Version Of Jquery Ui?
Answer :
1.11.4 / dated 11 March 2015

Question 7. How To Add Css Property On Last Div?
Answer :
$(‘div:last’).css({backgroundColor: ‘green’, fontWeight: ‘bolder’});


Question 8. What Is $.noconflict()?
Answer :
<script src=”https://code.jquery.com/jquery-1.6.2.js” type=”text/javascript”></script>
<script type=”text/javascript”>
$.noConflict()
</script>
When we call to $.noConflict(). Old references of $ are saved during jQuery initialization, noConflict() simply restores them.

Question 9. Can We Use Another Variable Instead Of $ In Jquery? If Yes, How?
Answer :
Yes, we can.
var jQ = jQuery.noConflict();
/** Now use jQ instead of $ **/
jQ( “div#pid” ).hide();


Question 10. How To Remove Close Button On The Jquery Ui Dialog Using Css?
Answer :
.ui-dialog-titlebar-close
{
  visibility: hidden;
}


Question 11. How To Remove Close Button On The Jquery Ui Dialog Using Javascript?
Answer :
$(“#div2”).dialog(
{
  closeOnEscape: false,
  open: function(event, ui)
{
$(“.ui-dialog-titlebar-close”, ui.dialog | ui).hide();
}
}
);


Question 12. How To Initialize A Dialog Without A Title Bar?
Answer :
var dialogOpts=[]
$(“#divId”).dialog(dialogOpts);
//Remove the title bar
$(“.ui-dialog-titlebar”).hide();


Question 13. How To Call Hook Into Dialog Close Event In Jquery Ui?
Answer :
$(‘div#contentId’).on(‘dialogclose’, function(event)
{
    //console.log(‘closed event called’);
}
);


Question 14. How To Download Jquery Ui Css From Google’s Cdn?
Answer :
Uncompressed: http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.js
Compressed: http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js

Question 15. How To “change Button Text” In Jquery?
Answer :
jQuery Version < 1.6
$(“#elementId”).attr(‘value’, ‘Save’); //versions older than 1.6
jQuery Version > 1.6
$(“#elementId”).prop(‘value’, ‘Save’); //versions newer than 1.6


Question 16. How Can I Disable A Button In A Jquery ?
Answer :
$(‘#divId’).attr(“disabled”, true);


Question 17. How Do I Keep Jquery Ui Accordion Collapsed By Default?
Answer :
$(“#divId”).accordion
(
{
header: “h4”, collapsible: true, active: false
}
);


Question 18. How To Call A Dragable Widget?
Answer :
// Make #draggable draggable
$(function ()
{
        $(“#draggableDivId”).draggable();
}
);


Question 19. How Do I Disable A Jquery-ui Draggable Of Widget?
Answer :
//myObject is widget object.
myObject.draggable( ‘disable’ );

OR, you can set during the initalization
$(“#yourDialogId”).dialog({
    draggable: false
});


Question 20. How To Remove Jquery Ui Autocomplete Helper Text?
Answer :
.ui-helper-hidden-accessible { display:none; }


Question 21. How To Set Year In Datepicker?
Answer :
$(“.datepickerClass”).datepicker(
{
    yearRange: ‘1950:2013’,
  changeMonth: true,
  changeYear: true,
  showButtonPanel: true,
}
);

Question 22. How To Set Current Date In Date Picker?
Answer :
$(“.datepickerClass”).datepicker(‘setDate’, new Date());

Javascript Advanced Tutorial
Question 23. How To Change Date Format In Jquery Ui Datepicker?
Answer :
var date = $(‘#datepickerDivId’).datepicker
(
{ dateFormat: ‘dd-mm-yy’
}
).
val();

Leave a Comment

Your email address will not be published. Required fields are marked *

error: Content is protected !!