Basic Interview Questions
Basic Interview Questions
Basic Interview Questions
$ Symbol is just replacement of jquery means at the place of $ you may use jquery hence $ symbol is used for indication that this line used for jquery universal selector in query is *
down vote
accept ed
.bind() attacheds events to elements that exist or match the selecto made. Any elements created afterwards or that match going forward changed, will not fire the bound event. .live() works for existing and future matching elements.
Array Sort:
Normal array: array.sort(); array.reverse(); numerical array: var points = [40,100,1,5,25,10]; points.sort(function(a,b){return a-b});
String Operation
//lastIndexOf(substr, [start]) var myString = 'javascript rox'; console.log(myString.lastIndexOf('r'));
//replace(substr, replacetext) var myString = '999 JavaScript Coders'; console.log(myString.replace(/JavaScript/i, "jQuery"));); finite value check
isFinite(value) What does isNaN function do?
By default, all requests are sent asynchronously. true and false for synchronous
animation zoom
$("#imgId").animate({ height: '800', width: '800' }, 1000, function() {
});
Append in jquery
$('.box').append("<div class='newbox'>I'm new box by append</div>"); $("<div class='newbox'>I'm new box by appendTo</div>").appendTo('.box');
document.getElementById("myText").style.fontSize = "20";
SQL
What is DDL, DML and DCL ?
If you look at the large variety of SQL commands, they can be divided into three large subgroups. Data Definition Language deals with database schemas and descriptions of how the data should reside in the database, therefore language statements like CREATE TABLE or ALTER TABLE belong to DDL. DML deals with data manipulation, and therefore includes most common SQL
statements such SELECT, INSERT, etc. Data Control Language includes commands such as GRANT, and mostly concerns with rights, permissions and other controls of the database system
How do you return the a hundred books starting from 25th?
sort
order by col_name
Deference between delete and drop a table How do you get a portion of a string?
SELECT SUBSTR(title, 1, 10) from table The RIGHT JOIN keyword returns all the rows from the right table (table_name2), even if there are no matches in the left table (table_name1). The LEFT JOIN keyword returns all rows from the left table (table_name1), even if there are no matches in the right table (table_name2). The INNER JOIN keyword returns rows when there is at least one match in both tables
The possible value of the "Position" attributes are absolute fixed inherit relative static
How to display a link without underline and display underline when mouseover on the link using CSS?
a{text-decoration:none;} a:hover{text-decoration:underline;} different type of embedding stylesheet 1) Inline style 2) External style sheet 3) Internal style sheet
Canvas
The HTML5 <canvas> element is used to draw graphics, on the fly, via scripting (usually JavaScript). 1. 2. 3. 4. 5. 6. 7. 8. 9. <canvas id=pcdsCanvas width=500 height=400> </canvas> <script type=text/javascript> var pcdsCanvas=document.getElementById(phpzagCanvas ); var pcdsText=pcdsCanvas.getContext(2d); pcdsText.fillStyle=#82345c; pcdsText.fillRect(0,0,150,75); </script>
SessionStorage stores data for one session.The data is deleted when the user closes the browser window. 1. 2. 3. 4. <script type=text/javascript> sessionStorage.lastname=ZAG; document.write(sessionStorage.lastname); </script>
Yes we can use below new input type Attribute in HTML5 Type Value The input is of type tel telephone number The input field is a search search field url email datetime date a URL One or more email addresses A date and/or time A date
A month A week The input value is of type time A local date/time A number A number in a given range A hexadecimal color, like #82345c