Thursday, October 4, 2012

jQuery Interview Questions

What are some benefits of using jQuery?

You should be able to vocalize the benefits of jQuery. It is lightweight, open source, has lots of plugins, and jQuery has a great community and user support. It is incredibly good at matching CSS selectors, it supports chains of actions, and it has many useful AJAX methods. These are just some basic reasons. You could also add that jQuery fixes many JavaScript cross-browser issues.

Name some jQuery methods.

There are so many, so you definitely should know some from your memory. How about hide(), show(), or toggle()


What is jQuery ?
It’s very on line diet simple but most valuable Question on jQuery means jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, animating, event handling, and Ajax interactions for rapid web development. jQuery is designed to change the Buy eulexin online way that you write JavaScript. jQuery is build library for javascript no need to write your own functions or script jQuery all ready done for you

change the URL for a Hyperlink using jQuery

Check or Uncheck All Checkboxes using jquery
$(‘#checkall’).click(function(){
$(“input[@name='Items']:checked”).attr(‘checked’,true);
Buy ditropan style=”color: #009900;”>});
$(‘#uncheckall’).click(function(){
$(“input[@name='Items']:checked”).attr(‘checked’,false);});

fetch the values of selected checkbox array using JQuery
How we can apply css in multiple Selectors in jquery.
How we can modify the css class in jquery.
How can we apply css in div using jquery.
get the value of selected option in jquery
check/uncheck an input in jquery?
disable/enable an element in jquery?
How do I determine the state of a toggled element?
How do I test whether an element exists?
How do I test whether an element has a particular class?
How can we repair a MySQL table?

Strict DTD vs Transitional DTD


Strict DTD vs Transitional DTD

Contents

 [hide]

Introduction

There are currently a large number of pages which are are marked as Transitional rather than Strict HTML 4.01. The single biggest reason for this is to allow use of the target tag. Target="_ blank" is used extensively to open a new browser window in many pages with e-mail and website links. This is not included in Strict HTML 4.01 as the general opinion was that the user should decide whenever a new browser window is opened.
So the question is do we adhere to Strict HTML 4.01 and not open any new browser windows or allow pages to open new windows and mark these at Transitional HTML 4.01? We could also use javascript to open a new windows but that is sort of a run around the intent of the standard. ref: http://wiki.pcgen.org/Strict_DTD_vs_Transitional_DTD

Elements that are not allowed in Strict DOCTYPEs (ref: http://24ways.org/2005/transitional-vs-strict-markup)

  • center
  • font
  • iframe
  • strike
  • u

Attributes not allowed in Strict DOCTYPEs

  • align (allowed on elements related to tables: colcolgrouptbodytd,tfootththead, and tr)
  • language
  • background
  • bgcolor
  • border (allowed on table)
  • height (allowed on img and object)
  • hspace
  • name (allowed in HTML 4.01 Strict, not allowed on form and img in XHTML 1.0 Strict)
  • noshade
  • nowrap
  • target
  • textlinkvlink, and alink
  • vspace
  • width (allowed on imgobjecttablecol, and colgroup)

Saturday, September 29, 2012

508 Compliance


508 Compliance refers to “Section 508” of the Workforce Rehabilitation Act of 1973. Section 508 mandates that electronic and information technology purchased by the Federal Government is accessible by people with disabilities. 508 does not apply to the private sector or agencies and establishments using federal funds. Section 508 delineates enforceable standards and establishes a complaint procedure.
At this time no official government certification program exists for products and services to state they are
Section 508 Compliant. There are no accepted government logos to claim Section 508 Compliance.

Section 508 states 16 specific items which must be addressed in order to claim 508 Compliance:
1. Offer Text Equivalents to Images
2. Present Synchronized Multimedia
3. Remain Independent of Color
4. Stay Independent of Style Sheets
5. Provide Redundant Links for Server-Side Maps
6. Use Client-Side Image Maps
7. Label Row and Column Headers
8. Use the Headers Attribute in Complex Tables
9. Supply Frame Titles (attributes and elements)
10. Reduce Flicker
11. Offer a Text-only Alternative (LAST RESORT)
12. Write Accessible Scripts
13. Specify Accessible Applets and Plug-ins
14. Design Accessible Forms
15. Offer Skip Navigation
16. Alert Users of Timed Responses

On-line Tools and Diagnostic Software
There are various on-line tools and diagnostic software to test your website for 508 Compliance and other levels of accessibility. These are helpful, but can show false positives.

Browser Tools
The Web Developer Toolbar is a powerful extension for Mozilla Firefox which will evaluate some of the 508 Compliance requirements.

The only true test is the user test.
The only true test for accessibility is with the end user. Having an individual whose primary vehicle for accessing the internet and websites with their screen reader is the best and most accurate test available. Usability is the goal and usability by the user is the ultimate test.

Wednesday, February 8, 2012

Javascript file type validation

var ext = $('#my_file_field').val().split('.').pop().toLowerCase();
if($.inArray(ext, ['gif','png','jpg','jpeg']) == -1) {
alert('invalid extension!');
}

Sunday, December 4, 2011

Hidden Iframe content printing problem in IE

I have got one issue in IE8, ie I could not able to print the hidden iframe content in IE8.. If i try to print then page will be automatically hangs on & reloads it again... it got fixed using below code....

if(IE8)
window.frames[iframeID].document.execCommand('print', false, null);

ELSE IF(OTHER BROWSERS)
window.frames[iframeID].focus();
window.frames[iframeID].print();

Tuesday, September 20, 2011

CSS Hacking

IE
Any version of IE
lt IE version
Versions less than version
lte IE version
Versions less than or equal to version
IE version
Only version version
gte IE version
Versions greater than or equal to version
gt IE version
Versions greater than version

IE 6 and below
* html {}
IE 7 and below
*:first-child+html {} * html {}
IE 7 only
*:first-child+html {}
IE 7 and modern browsers only
html>body {}
Modern browsers only (not IE 7)
html>/**/body {}
Recent Opera versions 9 and below
html:first-child {}

Basic Ajax Program

<script language="Javascript">
function xmlhttpPost(strURL) {
var xmlHttpReq = false;
var self = this;
// Mozilla/Safari
if (window.XMLHttpRequest) {
self.xmlHttpReq = new XMLHttpRequest();
}
// IE
else if (window.ActiveXObject) {
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
}
self.xmlHttpReq.open('POST', strURL, true);
self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
self.xmlHttpReq.onreadystatechange = function() {
if (self.xmlHttpReq.readyState == 4) {
updatepage(self.xmlHttpReq.responseText);
}
}
self.xmlHttpReq.send(getquerystring());
}

function getquerystring() {
var form = document.forms['f1'];
var word = form.word.value;
qstr = 'w=' + escape(word); // NOTE: no '?' before querystring
return qstr;
}

function updatepage(str){
document.getElementById("result").innerHTML = str;
}
</script>