Showing posts with label Web Interview Questions. Show all posts
Showing posts with label Web Interview Questions. Show all posts

Wednesday, October 28, 2015

AngularJS Questions and Answers

8) List out the differences between java Script and angular JS expressions?
Below are the list of differences between java script and angular JS
  • In Javascript expressions are being evaluated from the global window whereas in angularJS it is being evaluated from scope object.
  • Conditions, Loops and Exceptions are not supported in AngularJS as in Javascript.
9) Explain controller in AngularJS?
Controller is constructor function in AngularJS. Controller can be attached to DOM using “ng-controller” attribute.
10) Which and all browsers support AngularJS?
All major browsers like – Chrome, Safari, Firefox, Opera 15+, IE 9+ will support AngularJS.
11) How AngularJS is used to handle the security hurdles?
Below are the list of security hurdles handled by AngularJS –
  • Used for preventing CSS attacks
  • Used for preventing XSRF protection
  • Used for preventing HTML injection

Tuesday, October 27, 2015

JQuery Interview Questions and Answers

9) How to show the alert message on button click in Jquery?
Jquery is one of the most powerful libraries what we have and it provides event handling. This scenario can be handled by “OnClick” of the button. Below is the code snippet –
<input type=”button” id=”myButton” onclick=”alert(‘Hi’)” />
10) What is the meaning of Selectors in Jquery?
In javascript we have several methods to find the controls like – “getElementByName” and “getElementByID”, which is used to find the control based on Name of the control and ID of the control respectively. Similarly in Jquery we have find the controls using selectors. Below are some of the selectors -
  • “*” - To Find all the elements of the page.
  • “#” – Used to find the control by ID.
  • “.” - Used to find the control by Class.
11) In ASP.NET, Jquery will be added in Content and Master pages both?
No. If the Jquery file added in master page then content pages will going to use that.
12) What is the advantage of using minified version of Jquery?
Advantage of using minified verison of Jquery will mainly be performance. Size of the minified jquery file will be around 76KB where as the normal Jquery file size will be around 180KB.
13) Can you give an example of selecting an element based on its class name ?
Below is the sample code snippet –
$(‘.MyControl’).Hide()
14) What are the difference between “Length” and “Size” in Jquery?
Both are used to find number of elements in an object. “Length” will be used commonly because it’s faster compared to “size” because “length” is a property and “size” is a method.
15) How can we set the page title in Jquery?
Below is the code snippet used to set the page title -
$(function(){
$(document).attr(“title”, “A4 Academics”);
});
16) What is the use of Jquery Connect?
Connect method is used to bind one function to another and it’s used to execute the function when a function is executed from another object.
17) How to use AJAX in Jquery?
Jquery supports AJAX calls, below is the code snippet of AJAX in Jquery –
$.ajax({
url: ‘MyURL',
success: function(response) {
//My Code goes here
},
error: function(err) {
//My Code goes here }
});

Monday, October 26, 2015

HTML/HTML5 Interview Questions and Answers

11) How to use <form> in HTML?
Below is the syntax of <form> in HTML form –
<form action="[URL]">
When form is submitted then form data has been sent to URL, which is specified in the URL attribute. URL is referred to server side program.

12) What is hyperlink in HTML?
Hyperlinks can be used in images and for texts. Below is the examples of using hyperlinks –
<a href=”My URL “>…</a>
13) Explain <ul> in HTML?
In HTML <ul> defined for unordered list. <li> tags will be used along with <ul>.
<ul>
<li>Add</li>
<li>Subtract</li>
<li>Divide</li>
</ul>
14) Explain type and value attributes of <li> in HTML?
Type attribute in <li> is used to specify the style of bullet point of an item in list.
Value attribute in <li> tag is used to set the value of list item in list.
Syntax for type and value of <li>
<li type="a">Add</li>
<li value="100">Add</li>
15) How to set the focus to the element in HTML?
Below is the sample code to set the focus for HTML element –
<input type="text" id="mytestinput" name="mytestinput" ...>
<script type="text/javascript">
document.myform.mytestinput.focus();
</script>

Sunday, October 25, 2015

Javascript Interview Questions and Answers

11) What is “SetTimeOut” function in javascript?
“SetTimeOut” function is used to call the function given as a parameter after some time delay. Below is the javascript code for the same –
setTimeout(function(){ alert("Text to Show"); }, 5000);
12) What is “SetInterval” function in javascript?
“SetInterval” function is used to call the function (given as a parameter) repeatedly after some time delay. Below is the javascript code for the same –
setInterval (function(){ alert("Text to Show"); }, 5000);
13) What is “ClearInterval” function in javascript?
“ClearInterval” function is used to clear the time set from function – “SetInterval()”.
14) How to give comments in javascript?
  • For single line comment – “//”
  • For multi-line comments – “/* */”
15) Why to use “===” operator in javascript?
“===” operator is called strict operator and it returns true when both the values are same and returns false when the values are not same.

Thursday, October 22, 2015

AngularJS Questions and Answers

1) What is AngularJS?
AngularJS is developed by Google and it is an open source framework and it is used to create one page web apps or single page application using JavaScript, HTML and CSS.
2) What are the uses of AngularJS?
Below are the uses of AngularJS –
  • It uses MVC pattern.
  • Allows to create our own directive for making components reusable. 
  • Used for two way binding i.e, connecting model and view.
  • Supports Dependency Injection (DI)
3) Explain the features of AngularJS?
Below are the list of AngularJS features –
  • Model
  • View
  • Controller
  • Scope
  • Data Binding
  • Services
  • Filters
  • Directives
  • Testable
4) Explain scope in AngularJS?
Scope will act like a glue between view and controller and scopes are arranged in hierarchical structure

Wednesday, October 21, 2015

JQuery Interview Questions and Answers

1) What is Jquery?
Jquery is javascript library and it is used for HTML DOM access (manipulating and traversing of HTML DOM elements). It provides most powerful feature of event handling as well.
2) Explain we can use Jquery?
Jquery can be used along with other libraries. It works with simple and complex javascript and AJAX.
3) How we can use Jquery in ASP.NET?
We can use Jquery by downloading the jquery and use it in our project or can use CDNs available from Google, Microsoft and give the CDN URL in ASPX page.
4) Explain difference between Jquery and Javascript?
Jquery is a library and Javascript is a language and Jquery provides full-fledged support for javascript language.

Tuesday, October 20, 2015

Javascript Interview Questions and Answers

1) What is Javascript?
Javascript is a client side scripting language which is understood by the browsers and will be added in the HTML code.
2) Explain Javascript Types?
Below are some javascript types –
  • Boolean
  • String
  • Number
  • Null
  • Object
  • Function
  • Undefined
3) Why to use NaN in javascript?
“NaN” function is used check the number in the argument. If it does not contain number then it will return true else it will return false.
4) Explain negative infinity?
“Negative Number” is a number which is obtained from dividing the negative number by zero.
5) Can javascript code be broken into multiple lines?
Yes it is possible to break the javascript code to multiple lines using backslash ‘\’.
Eg: document.write(“My Test \a Content”);