You are on page 1of 22

ues: 2 Why we use SOAP?

Ans: transfer the data Ques: 3 Do Ajax applications always deliver a better experience than traditional web applications? Ans: Ajax made interaction designers more flexibility. However, the more power we have, the more caution we must use in exercising it. You should careful when you use Ajax to enhance the client experience of our applications. Ques: 4 How to send an image using Ajax? Ans: Yes, you can send an image with Ajax. Like that Google Maps.As per Ajax request Urls of images send as the response and we can set those URLs using DHTML. Example: Tn this example an XML document is returned from an AJAX. <categories> <category> <cat-id>001</cat-id> <name>IT</name> <description>Improve your skill</description> <image-url>IT_image.gif</image-url> </category> <category> <cat-id>002</cat-id> <name>Mathematics</name> <description>Solve problem easily</description> <image-url>mathematics.gif</image-url> </category> </categories> We use image-url element to contain the location of the URL.The callback method that we used in AJAX interaction will parse the response XML document and call the addCategory function. The addCategory function looks up a table row element "categoryTable" in body of the page and adds a row to the element that is use to contains the image. <scrip type="text/javascript" > ... function addCategory(id, name, imageSrc) { var categoryTable = document.getElementById("categoryTable"); var row = document.createElement("tr"); var catCell = document.createElement("td"); var img = document.createElement("img"); img.src = ("images\" + imageSrc); var link = document.createElement("a"); link.className ="category"; link.appendChild(document.createTextNode(name)); link.setAttribute("onclick", "catalog?command=category&catid=" + id); catCell.appendChild(img); catCell.appendChild(link); row.appendChild(catCell); categoryTable.appendChild(row); } </script> ...

<table> <tr> <td width="300" bgoclor="lightGray"> <table id="categoryTable" border="0" cellpadding="0"></table> </td> <td id="body" width="100%">Body Here</td> </tr> </table> source of the image is set to the image source. And we can load the image using a subsequent HTTP request for the image at the URL. "images/IT_image.gif" or "images/Mathematics.gif" This will occur when you add the image in the categoryTable. Ques: 5 Explain about security of the Ajax based web applications? Ans: We want to confirm that XMLHttpRequest object is subjected to the browsers security sandbox.When we requested about resources by the XMLHttpRequest object and it must reside within the same domain from which the calling script originated from which the calling script requested. In XMLHttpRequest we can't requested for services due to security restriction,outside the domain(from which the script was originally served). Ques: 6 Explain the disadvantage of Ajax.Which related to browser integration? Ans: When we created dynamic pages using Ajax than these pages doesn't back button(we use this button to go on previous pages. There are many ways to solve above problem.I have given you one of the best method called iframe to solve this problem. We can also bookmark a certain application in its state. Because User can also maintain the applications as changes the state of application. Ques: 7 Tell me about Ajax component frameworks provides? Ans: I have given you some features that are provided by ajax component frameworks.These features are: 1.Cusomization Applications 2.skinning facilities 3.extensibility 4.programmatic control. Above these functions are a bit slower in execution(with less control). Ques: 8 Tell me about direct ajax frameworks? Ans: If you want to use direct Ajax frameworks, Than you must require CSS, HTML and Ajax expertise. We should done authoring in HTML and the Ajax framework will deals with HTML elements directly . Ajax provide us many frameworks and API`s for many purposes like that commonly including functions(COM), event handling, DOM, and altering graphic rich elements. We can use these frameworks for shopping frameworks, But don't use this framework for applications which are based on web. Ques: 9 Tell me about multimedia functions of Ajax? Ans: Basically, Ajax has no facility of build-in multimedia function But it it can uses functionality of other browsers and plugin`s such as SVG, Quicktime and flash pugin.We can achieve multimedia in Ajax through mashup and hack. Multimedia functions are help us to build excellent application. We can obtain these multimedia functions from outside.

Ques: 10 Explain how Ajax is friendly with SEO? Ans: Because Ajax is a combination of many languages like: JavaScript,CSS etc. I have given you reason why Ajax is not so freindly with search engine indexing because much part of its code are written in JavaScript. So,Ajax may occur some problem websites have present dynamic data present.Generally, Search engines generally not to use index Javascript present in web pages. Ques: 11 Explain about the Response time when we are using Ajax? Ans: Response time: We can also known response time as latency.WE can dscribe response time as the interval between the time taken to process the request generated from the client on the server. Delay has been come when proper handling of the XMLHttprequestobject occour between the client and server request. Ques: 12 Tell me reason of using HTTP POST request by Ajax requests? Ans: Suppose that if you want to check whether an email address xyz@abc.com is used already or not with Ajax,because url doesn't supports character "@" in email addresses directly.so, we have to use HTTP POST. Ques: 13 What Ajax framework do you recommend for PHP applications? Ans: Prototype Ans: Prototype Ques: 14 How to handle te concurrent Ajax request? Ans: You can process more than one AJAX request process at a single time with using JavaScript. In proper post processing of code it is recommended that you use JavaScript Closures. I have given you example that shows an we can abstract XMLHttpRequest object by a JavaScript object called AJAXInteraction. When you pass argument in the URL to call and the function to call when completing the processing. function AJAXInteraction(url, callback) { var req = init(); req.onreadystatechange = processRequest; function init() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else if (window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); } } function processRequest () { if (req.readyState == 4) { if (req.status == 200) { if (callback) callback(req.responseXML); }

} } this.doGet = function() { req.open("GET", url, true); req.send(null); } this.doPost = function(body) { req.open("POST", url, true); req.setRequestHeader("Content-Type", " application/x-www-form-urlencoded"); req.send(body); } } function makeRequest() { var ai = new AJAXInteraction("processme", function() { alert("Post Processing is going on");}); ai.doGet(); } Above we use function to makeRequest() to create an AJAXInteraction with a URL to of "processme" and their is an inline function which is use to show alert dialog with the message "Post Processing is going on". When we called ai.doGet() function than the Ajax interaction is initiated and when server-side component mapped to the URL "processme" returns a document and we passed them to the callback function that was specified when the Ajax Interaction was created.We use callback function that is associated with a specific AJAX interaction.When we creating multiple closure objects in that make XmlHttpRequests as to there is a limited number of sockets that are used to make requests at any given time.We can made concurrently with the limited number of requests. In internet explorer at any given time allows for two concurrent Ajax requests. Generally,In case of other browsers we can allow more than three and five requests. Keep in mind when you making multiple AJAX calls from the client than their is no guaranty to return rspose at given order. Ques: 15 How I create my own AJAX functionality? Ans: If you want to create your own Ajax functionality means not want to reuse an existing Ajax component than you have to know about that I have given below. You should have to know Dynamic HyperText Markup Language(DHTML) because DHTML technology we used in foundation for AJAX. Because DHTML can enable browser-base real time interaction between a user and a web page. DHTML is the combination of JavaScript, the Document Object Model (DOM) and Cascading Style Sheets (CSS). JavaScript: It is an loosly typed scripting language.It is an object based scripting language which is supported by all major browsers and it is essential for AJAX interactions. JavaScript of a page performs when page is being loaded and when an event occour than associated JavaScript will called.Example: a mouse click, or a key press in a form element. DOM: It is an API for accessing and manipulating structured documents.Basically DOM is used to represent the structure of XML and HTML documents. CSS: Using CSS we can presents the page in different manner via present each like: fonts, colors, sizes, and position in different style. Using CSS we can

allow for a clear separation of the presentation from the content and may be changed programmatically by JavaScript. You should also have deep Understanding the basic request/response nature of HTTP. If you ignore the differences between the GET and OIst methods than many subtle bugs can result when configuring an XMLHttpRequest and HTTP response codes when processing callbacks. JavaScript: It is an client-side paste, in a sense.We use JavaScript to create the XMLHttpRequest Object and trigger the asynchronous call.It is also used to parse the returned content. Using JavaScript we can analyze the returned data and process returned messages. We use JavaScript to inject the new content into HTML page using the DOM API and use to modify the CSS.

Ques: 16 Write down different framework available in Ajax? Ans: For getting detailed information we have an available frame called Prototype.JS Framework.To handle Ajax and JavaScript is very easily and to use of concept of $ is very easily also. In Ajax their is no need to check cross browser, Open, Close and error handling through traditional Ajax. Ques: 17 What are the limitations of Ajax? Ans: Mainly Ajax is an client/server technology.In Ajax in the web client node does run run on server typically that react to HTTP GET and POST requests.Becuase clients can't communicate each other directly. 1.Using Ajax we can develop an distributed application developed which helps a central web server system to manage requests between clients. In this Client 1 can generate events/data for and can respond to events/data from Client 2. Using we can connect both to a common web server to help in communication. 2.Ajax is an slow or unreliable network connections.Because in case of traditional web applications that are required a full round-trip to the server may slowly for end users but we can predict them.Generally, end users would intuitively know they can have performed an action like that, submitting a form or clicking a link, and must to wait for a server to respond. When we use Ajax user amy have less intuition about reason of result waiting for a server response occours because of which type of events. connections may reduce usability if not carefully designed to accommodate both fast and slow network characteristics. Ques: 18 What is the back ground work going on when you type www.R4R.co.in in your web browser?

Ans: I have given you steps that was processed on back ground when you type www.R4R.co.in in web browser: Step1: In the first step browser sends a DNS request to the DNS server to resolve the name www.R4R.co.in.The DNS request may be a TCP or UDP request to the DNS server. Step2: When IP address is recieved, the browser makes a socket connection with that IP Adress and port 80.

Step3: Now, a Http GET request is fired by the browser on that socket connection and when the response starts coming it parses it and it will shows on the screen. Step4: Note depending on the content of the first response,multiple sockets might be open to fetch embedded images and objects in the same page. Ques: 19 What is the main difference b/w Ajax and JavaScript? Ans: Their is not much more difference between Ajax and JavaScript.Because Ajax is an "Asynchronous Javascript And XML". We can say that it is an new approach of reloading page. Using Ajax we can send an request to the server and reload the part of page every time.Ajax perform their task via to send an XMLHttpRequest to the server and fetch result according to the request. Using Ajax we can send an multiple request from the same page with reloading the requested part of the page. Ques: 20 What's the main purpose of Ajax? Ans: AJAX stands for Asynchronous Javascript and XML. Ajax provide us some useful features like that Using Ajax we can refresh the some part of page rather than refresh the whole page. Means that using Ajax we can decrease the load on server and incease its performance. 'or' Using Ajax we can refreshed asynchronously and to fetch information or response from server according to the client request.than we decrease the no of interaction of client to the server every time.

Page 2
Ques: 21 How to differenciate proxied and proxyless calls? Ans: The main difference b/w proxied and proxyless are given below: 1.Proxied calls: We made Proxied calls through stub objects which is used to mimic your PHP classes on the JavaScript side. Example: The helloajax class from the Hello Ajax example. 2.Proxyless calls: We can made the proxied calls using utility JavaScript functions like: HTML_AJAX.replace() HTML_AJAX.append() Ques: 22 What the main difference b/w Client-Side JavaScript and Server-Side JavaScript? Ans: I have given you some main difference b/w Client-Side JavaScript and ServerSide JavaScript that are given below: 1. Client-Side JavaScript covers the core language plus some other like that predefined objects, only relevant to running Javasript in a browser.Where as Server-Side JavaScript also covers the core language plus some other like that predefined objects and functions only relevant to running Javasript in a server. 2. We can embedded Client-Side JavaScript in the HTML pages directly and this can completly interpreted by browser at run time.Where as we compiled ServerSide JavaScripts are compiled before to deployed them.

Ques: 23 Should I use an HTTP GET or POST for my AJAX calls? Ans: Yes,we have to use an HTTP GET or POST for my Ajax calls.AJAX request should have to use an HTTP GET request when retrieving data from server and the data that was retrived will not be changed for a given request URL. We should use an HTTP POST when the state of data is updated on the server. Both the line with HTTP idempotency ecommendations and both are highly recommended for a consistent web application architecture. Ques: 24 Tell me Ajax is just another name for XMLHttpRequest or not? Ans: No,Ajax is not just an another name for XMLHttpRequest.Because XMLHttpRequest is only the part of the Ajax equation.Using XMLHttpRequest(It is an Technical Component) we can done the asynchronous server communication possible. We use Ajax to describe the overall approach in the artical. which is not trust only on XMLHttpRequest but on CSS, DOM, and some other technologies. Ques: 25 What you understand about applets and plugins? Ans: Please keep in mind don't dump your plugin or applet based portions of your web application too quickly.Yes, AJAX and DHTML can do drag and drop and other advanced user interfaces there still limitations especially when it comes with browser support. Using Plugins and applets we can made Ajax type request for many years. Applets has a good set of UI components and APIs using then developer can done literally anything. Generally, programmers try to ignore applets or plugins because this is a startup time to initialize the plugin and no guarantee that required version of a plugin of JVM is installed. Using Plugins and applets we can't has write to control the DOM page. When you are in uniform environment or can depend on a specific JVM or plugin version being available (like:corporate environment) a plugin or applet solution is good. Ques: 26 What you understand exactly with W3C DOM? Ques: 27 How do I provide internationalized AJAX interactions? Ans: If you use XML than it doesn't have mean that can send and receive localized content properly using Ajax request.You should have to do these when you provide internationalized Ajax components. 1. To set the charset of the page to an encoding that's supported by your aim languages. I given to use UTF-8 because it covers the most of the languages.I have given you a meta declaration in a HTML/JSP page that will set the content type. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 2. Using JavaScript you can make sure to encode any parameters sent to the server.It give us escape() function which returns Unicode escape strings(use to show localized text in hexadecimal format).Some JavaScript encoding functions are escape(),encodeURI()and encodeURIComponent(). 3.Using HttpServletRequest.setCharacterEncoding() method we can set the character encoding on the server-side component. Before you access the localized parameter using HttpServletRequest.getParameter() call. You can use UTF like that request.setCharactherEncoding("UTF-8");.

A server-side component returning AJAX responses needs to set the encoding of the response to the same encoding used in the page. response.setContentType("text/xml;charset=;UTF-8"); response.getWriter().write(" <response>invalid </response>"); Ques: 28 How Ajax applications are much easier to develop as compare to traditional web applications? Ans: Generally, Ajax applications necessarily used to running complex JavaScript code on the client side.If you want that your complex code efficient and bugfree. Than you should not to taken this task lightly. When you want to perform that task(made complex code efficient and bug-free) you should use development tools and frameworks. Ques: 29 Why HTML_AJAX server will hang when we install some server? Ans: When you run an HTML_AJAX problem only on some servers their are some chances running into a problem with output compression.When you handle output compression in PHP Config we can detect the problem and do the right thing but when you done this from an apache extension their is no way to know how it is going to compress the body. May be some times setting HTML_AJAX::sendContentLength to false fixes the problem, but whenyou deal with some other cases you should disabled the extension for the AJAX pages. Some problems happened by debugging extensions like: XDebug, disabling the extension on the server page usually fixes those problems dealing with Using general JavaScript development and HTML_AJAX . Ques: 30 How can we compare HTML_AJAX with XAJAX project at Sourceforge? Ques: 31 How we perform task to send an image using Ajax? Ques: 32 What Ajax makes a "new" approach when we have tchniques for asyncronous server communication already? Ans: We use asynchronous server comunication techniques in real-world applications to change the fundamental interaction model of the Web. Ajax use now because these technologies and the industry's understanding of how to deploy them most effectively have taken time to develop. Ques: 33 What are security issues with Ajax? Ans: Some main security issues ragarding Ajax are given below: 1.When we selecting view source of the page with JavaScript it gives a plain view to client. 2.When user does not granted permission than JavaScript can not access the local filesystem. 3.Ajax only interact with server side component from which we loaded that page. 4.Use of proxy pattern can enable Ajax interactions with external services. 5.You have to consider HTTPS to secure connection when you even try to exchange some confidential information. Ques: 34 How we get XMLHttpRequest object? Ans: To getting XMLHttpRequest object on the browser it totally depends on type of browser. Example: if (window.ActiveXObject) { // Internet Explorer

http_request = new ActiveXObject("Microsoft.XMLHTTP"); } Ques: 35 How to submit a form or part of a form without refresh the page? Ans: If you created a form I told you have to set "form" element and "onSubmit" attribute into JavaScript function that returns false. Example: <form onSubmit="doAJAXSubmit();return false;" ><input type="hidden" name="phpMyAdmin" value="f43d4e0b88acea2d2a393515f6bf38f2" /><input type="hidden" name="phpMyAdmin" value="70ac9566533a2665b6597346aab7f985" /> <input type="text" id="tf1" /> <input type="submit" id="submit1" value="Update"/> </> If you want to submit data than you perform that task when we associated a function with form button. Example: <form onSubmit="doAJAXSubmit();return false;" ><input type="hidden" name="phpMyAdmin" value="f43d4e0b88acea2d2a393515f6bf38f2" /><input type="hidden" name="phpMyAdmin" value="70ac9566533a2665b6597346aab7f985" /> <input type="text" id="tf1" /> <input type="button" id="button1" onClick="doAJAXSubmit()" value="Update"/> </> "onSubmit" attribute is still set.When client hits the enter key in the text field the form will be submitted.To handle this we have solution write below. When you updating the page than you have make sure that AJAX update of the form data was successful before updating the data in the page. Otherwise, The data may not properly update and the Client may not know. I like to provide an informative message when doing a partial update and upon a successful AJAX interaction after that I will update this page. Ques: 36 What happen when server to interact with an Ajax client? Ques: 37 Tell me about different frameworks that are available in Ajax? Ques: 38 Who is the discoverer of Ajax? Ans: Ajax none discovered by person.Ajax is an XMLHTTPRequest object which is first implemented by Microsoft in Internet Explorer 5 as an ActiveX object for windows. After that it is called as Asynchronous Javascript and XML(AJAX). Ques: 39 How you differenciate b/w DOM Parser and AUX Parser? Ans: I have given you main difference b/w DOM Parser and AUX Parser given below: Using domxml we can use DOM parser at server side in php.Where as wwe used AUX Parser in JavaScript at client side. Ques: 40 How you define Mashups in Ajax? Ans: Ajax Mashup is an hybrid web application. Ajax Mashup uses Ajax techniques to present a rich UI that can updates itself in place by using content that it retrieves asynchronously from multiple sources. In this server sends an initial page to the browser, which then makes calls to retrieve updated content. These calls are used to made directly to the third-party sources from the browser or back to the originating server, It is act as a proxy for the third-party content.

Page 3

Ques: 41 How to handle asyncronous processing using Ajax? Ans: Using Ajax we perform asynchronous data transfer according to HTTP request b/w the client browser and server. Using Ajax we can allow task from web pages to request only little bit of information from server without loading whole page again. Uxing Ajax our JavaScript can communicate with server directly through an JavaScript XMLHttpRequest object.This object help us JavaScript to trade data from sever without reloading the whole page. Use: Use of Ajax technique to make web applications smaller,faster and more friendly to user. Ques: 42 What types of technologies combined in Ajax? Ans: For implementation Ajax combined client side technolgies. Technolgies that are combined in Ajax are given below. JavaScript DHTML HTML Ques: 43 How you define Comet in Ajax? Ans: Ajax Push is an Comet Technology. Using Ajax Push web servers can send an data to the user without any need the user request for it. Using this user can make up-to-date with data arriving or varying onthe server,without any frequent polling. Ques: 44 How you define JSON in Ajax? Ans: Some main points about JSON are given below: 1.JSON stand for JavaScript Object Notation. 2.JSON is an lightweight data interchange format. 3.JSOn gives us JavaScript eval() method to parse an XML easily. Ques: 45 How we can say user interfaces are powerful in Ajax? Ques: 46 Uploading file using Ajax is possible or not? Ans: No,we can't perform an uploading file task with Ajax.I have given you a method this is using iframe and upload files to give feel like Ajax file upload. This is used by many scripts and libraries in their Ajax file upload plugins. Ques: 47 Tell me about environment that we used in Ajax? Ans: Ajax support many environment like that PHP/ASP and other web based projects. Ques: 48 Why Ajax is comfortable fit with Java? Ans: Because Java is a more comfortable for AJAX. Than you can use Java Enterprise Edition servers to generate Ajax client pages and to serve incoming Ajax requests and to manage server side state for Ajax clients and connect Ajax clients to your enterprise resources. The JavaServer Faces component model is a more comfortable for defining and using Ajax components. Ques: 49 How to use an Ajax code across different browsers? Ans: Internet Explorer uses an ActiveXObject while other browsers uses the builtin JavaScript object called XMLHttpRequest. Example: <html>

<body> <script type="text/javascript"> function ajaxFunction() { var xmlHttp; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser doesn't supported by Ajax!"); return false; } } } } </script> Ques: 50 Tell me reasons of using HTTP POST request by Ajax request? Ques: 51 Whar you understand by Ajax Polling? Ans: By using Ajax Polling script we can send request to the server and receives response according to request from server. Using Ajax we can return the response to your browser. Ajax is an light weight.So,it is the act of retrieving data from server regularly to obtain near like data. Ques: 52 What is Ajax? Ans: AJAX is stands for Asynchronous Javascript And XML. Ajax was first comes at 2005.It is an web development technique used to make interactive web applications and rich internet applications. Ajax is based on JavaScript and HTTP request. Ajax are use to retrieve data from server asynchronously to web applications without any interfere with display and characterisics of existing page. Using Ajax we can inhance interactive animation on web pages. Using Ajax we can create better,faster and more user friendly web applications.

Page 1
Ques: 1 What is Ajax?

Ans: AJAX is stands for Asynchronous Javascript And XML. Ajax was first comes at 2005.It is an web development technique used to make interactive web applications and rich internet applications. Ajax is based on JavaScript and HTTP request. Ajax are use to retrieve data from server asynchronously to web applications without any interfere with display and characterisics of existing page. Using Ajax we can inhance interactive animation on web pages. Using Ajax we can create better,faster and more user friendly web applications. Ques: 2 Whar you understand by Ajax Polling? Ans: By using Ajax Polling script we can send request to the server and receives response according to request from server. Using Ajax we can return the response to your browser. Ajax is an light weight.So,it is the act of retrieving data from server regularly to obtain near like data. Ques: 3 Tell me reasons of using HTTP POST request by Ajax request? Ques: 4 How to use an Ajax code across different browsers? Ans: Internet Explorer uses an ActiveXObject while other browsers uses the builtin JavaScript object called XMLHttpRequest. Example: <html> <body> <script type="text/javascript"> function ajaxFunction() { var xmlHttp; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser doesn't supported by Ajax!"); return false; } } } } </script>

Ques: 5 Why Ajax is comfortable fit with Java? Ans: Because Java is a more comfortable for AJAX. Than you can use Java Enterprise Edition servers to generate Ajax client pages and to serve incoming Ajax requests and to manage server side state for Ajax clients and connect Ajax clients to your enterprise resources. The JavaServer Faces component model is a more comfortable for defining and using Ajax components. Ques: 6 Tell me about environment that we used in Ajax? Ans: Ajax support many environment like that PHP/ASP and other web based projects. Ques: 7 Uploading file using Ajax is possible or not? Ans: No,we can't perform an uploading file task with Ajax.I have given you a method this is using iframe and upload files to give feel like Ajax file upload. This is used by many scripts and libraries in their Ajax file upload plugins. Ques: 8 How we can say user interfaces are powerful in Ajax? Ques: 9 How you define JSON in Ajax? Ans: Some main points about JSON are given below: 1.JSON stand for JavaScript Object Notation. 2.JSON is an lightweight data interchange format. 3.JSOn gives us JavaScript eval() method to parse an XML easily. Ques: 10 How you define Comet in Ajax? Ans: Ajax Push is an Comet Technology. Using Ajax Push web servers can send an data to the user without any need the user request for it. Using this user can make up-to-date with data arriving or varying onthe server,without any frequent polling. Ques: 11 What types of technologies combined in Ajax? Ans: For implementation Ajax combined client side technolgies. Technolgies that are combined in Ajax are given below. JavaScript DHTML HTML Ques: 12 How to handle asyncronous processing using Ajax? Ans: Using Ajax we perform asynchronous data transfer according to HTTP request b/w the client browser and server. Using Ajax we can allow task from web pages to request only little bit of information from server without loading whole page again. Uxing Ajax our JavaScript can communicate with server directly through an JavaScript XMLHttpRequest object.This object help us JavaScript to trade data from sever without reloading the whole page. Use: Use of Ajax technique to make web applications smaller,faster and more friendly to user. Ques: 13 How you define Mashups in Ajax? Ans: Ajax Mashup is an hybrid web application. Ajax Mashup uses Ajax techniques to present a rich UI that can updates itself in place by using content that it retrieves asynchronously from multiple sources.

In this server sends an initial page to the browser, which then makes calls to retrieve updated content. These calls are used to made directly to the third-party sources from the browser or back to the originating server, It is act as a proxy for the third-party content. Ques: 14 How you differenciate b/w DOM Parser and AUX Parser? Ans: I have given you main difference b/w DOM Parser and AUX Parser given below: Using domxml we can use DOM parser at server side in php.Where as wwe used AUX Parser in JavaScript at client side. Ques: 15 Who is the discoverer of Ajax? Ans: Ajax none discovered by person.Ajax is an XMLHTTPRequest object which is first implemented by Microsoft in Internet Explorer 5 as an ActiveX object for windows. After that it is called as Asynchronous Javascript and XML(AJAX). Ques: 16 Tell me about different frameworks that are available in Ajax? Ques: 17 What happen when server to interact with an Ajax client? Ques: 18 How to submit a form or part of a form without refresh the page? Ans: If you created a form I told you have to set "form" element and "onSubmit" attribute into JavaScript function that returns false. Example: <form onSubmit="doAJAXSubmit();return false;" ><input type="hidden" name="phpMyAdmin" value="f43d4e0b88acea2d2a393515f6bf38f2" /><input type="hidden" name="phpMyAdmin" value="70ac9566533a2665b6597346aab7f985" /> <input type="text" id="tf1" /> <input type="submit" id="submit1" value="Update"/> </> If you want to submit data than you perform that task when we associated a function with form button. Example: <form onSubmit="doAJAXSubmit();return false;" ><input type="hidden" name="phpMyAdmin" value="f43d4e0b88acea2d2a393515f6bf38f2" /><input type="hidden" name="phpMyAdmin" value="70ac9566533a2665b6597346aab7f985" /> <input type="text" id="tf1" /> <input type="button" id="button1" onClick="doAJAXSubmit()" value="Update"/> </> "onSubmit" attribute is still set.When client hits the enter key in the text field the form will be submitted.To handle this we have solution write below. When you updating the page than you have make sure that AJAX update of the form data was successful before updating the data in the page. Otherwise, The data may not properly update and the Client may not know. I like to provide an informative message when doing a partial update and upon a successful AJAX interaction after that I will update this page. Ques: 19 How we get XMLHttpRequest object? Ans: To getting XMLHttpRequest object on the browser it totally depends on type of browser. Example: if (window.ActiveXObject) { // Internet Explorer http_request = new ActiveXObject("Microsoft.XMLHTTP"); } Ques: 20 What are security issues with Ajax?

Ans: Some main security issues ragarding Ajax are given below: 1.When we selecting view source of the page with JavaScript it gives a plain view to client. 2.When user does not granted permission than JavaScript can not access the local filesystem. 3.Ajax only interact with server side component from which we loaded that page. 4.Use of proxy pattern can enable Ajax interactions with external services. 5.You have to consider HTTPS to secure connection when you even try to exchange some confidential information.

Page 2
Ques: 21 What Ajax makes a "new" approach when we have tchniques for asyncronous server communication already? Ans: We use asynchronous server comunication techniques in real-world applications to change the fundamental interaction model of the Web. Ajax use now because these technologies and the industry's understanding of how to deploy them most effectively have taken time to develop. Ques: 22 How we perform task to send an image using Ajax? Ques: 23 How can we compare HTML_AJAX with XAJAX project at Sourceforge? Ques: 24 Why HTML_AJAX server will hang when we install some server? Ans: When you run an HTML_AJAX problem only on some servers their are some chances running into a problem with output compression.When you handle output compression in PHP Config we can detect the problem and do the right thing but when you done this from an apache extension their is no way to know how it is going to compress the body. May be some times setting HTML_AJAX::sendContentLength to false fixes the problem, but whenyou deal with some other cases you should disabled the extension for the AJAX pages. Some problems happened by debugging extensions like: XDebug, disabling the extension on the server page usually fixes those problems dealing with Using general JavaScript development and HTML_AJAX . Ques: 25 How Ajax applications are much easier to develop as compare to traditional web applications? Ans: Generally, Ajax applications necessarily used to running complex JavaScript code on the client side.If you want that your complex code efficient and bugfree. Than you should not to taken this task lightly. When you want to perform that task(made complex code efficient and bug-free) you should use development tools and frameworks. Ques: 26 How do I provide internationalized AJAX interactions? Ans: If you use XML than it doesn't have mean that can send and receive localized content properly using Ajax request.You should have to do these when you provide internationalized Ajax components. 1. To set the charset of the page to an encoding that's supported by your aim languages. I given to use UTF-8 because it covers the most of the languages.I have given you a meta declaration in a HTML/JSP page that will set the content type.

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 2. Using JavaScript you can make sure to encode any parameters sent to the server.It give us escape() function which returns Unicode escape strings(use to show localized text in hexadecimal format).Some JavaScript encoding functions are escape(),encodeURI()and encodeURIComponent(). 3.Using HttpServletRequest.setCharacterEncoding() method we can set the character encoding on the server-side component. Before you access the localized parameter using HttpServletRequest.getParameter() call. You can use UTF like that request.setCharactherEncoding("UTF-8");. A server-side component returning AJAX responses needs to set the encoding of the response to the same encoding used in the page. response.setContentType("text/xml;charset=;UTF-8"); response.getWriter().write(" <response>invalid </response>"); Ques: 27 What you understand exactly with W3C DOM? Ques: 28 What you understand about applets and plugins? Ans: Please keep in mind don't dump your plugin or applet based portions of your web application too quickly.Yes, AJAX and DHTML can do drag and drop and other advanced user interfaces there still limitations especially when it comes with browser support. Using Plugins and applets we can made Ajax type request for many years. Applets has a good set of UI components and APIs using then developer can done literally anything. Generally, programmers try to ignore applets or plugins because this is a startup time to initialize the plugin and no guarantee that required version of a plugin of JVM is installed. Using Plugins and applets we can't has write to control the DOM page. When you are in uniform environment or can depend on a specific JVM or plugin version being available (like:corporate environment) a plugin or applet solution is good. Ques: 29 Tell me Ajax is just another name for XMLHttpRequest or not? Ans: No,Ajax is not just an another name for XMLHttpRequest.Because XMLHttpRequest is only the part of the Ajax equation.Using XMLHttpRequest(It is an Technical Component) we can done the asynchronous server communication possible. We use Ajax to describe the overall approach in the artical. which is not trust only on XMLHttpRequest but on CSS, DOM, and some other technologies. Ques: 30 Should I use an HTTP GET or POST for my AJAX calls? Ans: Yes,we have to use an HTTP GET or POST for my Ajax calls.AJAX request should have to use an HTTP GET request when retrieving data from server and the data that was retrived will not be changed for a given request URL. We should use an HTTP POST when the state of data is updated on the server. Both the line with HTTP idempotency ecommendations and both are highly recommended for a consistent web application architecture. Ques: 31 What the main difference b/w Client-Side JavaScript and Server-Side JavaScript? Ans: I have given you some main difference b/w Client-Side JavaScript and ServerSide JavaScript that are given below:

1. Client-Side JavaScript covers the core language plus some other like that predefined objects, only relevant to running Javasript in a browser.Where as Server-Side JavaScript also covers the core language plus some other like that predefined objects and functions only relevant to running Javasript in a server. 2. We can embedded Client-Side JavaScript in the HTML pages directly and this can completly interpreted by browser at run time.Where as we compiled ServerSide JavaScripts are compiled before to deployed them. Ques: 32 How to differenciate proxied and proxyless calls? Ans: The main difference b/w proxied and proxyless are given below: 1.Proxied calls: We made Proxied calls through stub objects which is used to mimic your PHP classes on the JavaScript side. Example: The helloajax class from the Hello Ajax example. 2.Proxyless calls: We can made the proxied calls using utility JavaScript functions like: HTML_AJAX.replace() HTML_AJAX.append() Ques: 33 What's the main purpose of Ajax? Ans: AJAX stands for Asynchronous Javascript and XML. Ajax provide us some useful features like that Using Ajax we can refresh the some part of page rather than refresh the whole page. Means that using Ajax we can decrease the load on server and incease its performance. 'or' Using Ajax we can refreshed asynchronously and to fetch information or response from server according to the client request.than we decrease the no of interaction of client to the server every time. Ques: 34 What is the main difference b/w Ajax and JavaScript? Ans: Their is not much more difference between Ajax and JavaScript.Because Ajax is an "Asynchronous Javascript And XML". We can say that it is an new approach of reloading page. Using Ajax we can send an request to the server and reload the part of page every time.Ajax perform their task via to send an XMLHttpRequest to the server and fetch result according to the request. Using Ajax we can send an multiple request from the same page with reloading the requested part of the page. Ques: 35 What is the back ground work going on when you type www.R4R.co.in in your web browser?

Ans: I have given you steps that was processed on back ground when you type www.R4R.co.in in web browser: Step1: In the first step browser sends a DNS request to the DNS server to resolve the name www.R4R.co.in.The DNS request may be a TCP or UDP request to the DNS server. Step2: When IP address is recieved, the browser makes a socket connection with that IP Adress and port 80. Step3: Now, a Http GET request is fired by the browser on that socket connection and when the response starts coming it parses it and it will shows on the screen.

Step4: Note depending on the content of the first response,multiple sockets might be open to fetch embedded images and objects in the same page. Ques: 36 What are the limitations of Ajax? Ans: Mainly Ajax is an client/server technology.In Ajax in the web client node does run run on server typically that react to HTTP GET and POST requests.Becuase clients can't communicate each other directly. 1.Using Ajax we can develop an distributed application developed which helps a central web server system to manage requests between clients. In this Client 1 can generate events/data for and can respond to events/data from Client 2. Using we can connect both to a common web server to help in communication. 2.Ajax is an slow or unreliable network connections.Because in case of traditional web applications that are required a full round-trip to the server may slowly for end users but we can predict them.Generally, end users would intuitively know they can have performed an action like that, submitting a form or clicking a link, and must to wait for a server to respond. When we use Ajax user amy have less intuition about reason of result waiting for a server response occours because of which type of events. connections may reduce usability if not carefully designed to accommodate both fast and slow network characteristics. Ques: 37 Write down different framework available in Ajax? Ans: For getting detailed information we have an available frame called Prototype.JS Framework.To handle Ajax and JavaScript is very easily and to use of concept of $ is very easily also. In Ajax their is no need to check cross browser, Open, Close and error handling through traditional Ajax. Ques: 38 How I create my own AJAX functionality? Ans: If you want to create your own Ajax functionality means not want to reuse an existing Ajax component than you have to know about that I have given below. You should have to know Dynamic HyperText Markup Language(DHTML) because DHTML technology we used in foundation for AJAX. Because DHTML can enable browser-base real time interaction between a user and a web page. DHTML is the combination of JavaScript, the Document Object Model (DOM) and Cascading Style Sheets (CSS). JavaScript: It is an loosly typed scripting language.It is an object based scripting language which is supported by all major browsers and it is essential for AJAX interactions. JavaScript of a page performs when page is being loaded and when an event occour than associated JavaScript will called.Example: a mouse click, or a key press in a form element. DOM: It is an API for accessing and manipulating structured documents.Basically DOM is used to represent the structure of XML and HTML documents. CSS: Using CSS we can presents the page in different manner via present each like: fonts, colors, sizes, and position in different style. Using CSS we can allow for a clear separation of the presentation from the content and may be changed programmatically by JavaScript. You should also have deep Understanding the basic request/response nature of HTTP.

If you ignore the differences between the GET and OIst methods than many subtle bugs can result when configuring an XMLHttpRequest and HTTP response codes when processing callbacks. JavaScript: It is an client-side paste, in a sense.We use JavaScript to create the XMLHttpRequest Object and trigger the asynchronous call.It is also used to parse the returned content. Using JavaScript we can analyze the returned data and process returned messages. We use JavaScript to inject the new content into HTML page using the DOM API and use to modify the CSS.

Ques: 39 How to handle te concurrent Ajax request? Ans: You can process more than one AJAX request process at a single time with using JavaScript. In proper post processing of code it is recommended that you use JavaScript Closures. I have given you example that shows an we can abstract XMLHttpRequest object by a JavaScript object called AJAXInteraction. When you pass argument in the URL to call and the function to call when completing the processing. function AJAXInteraction(url, callback) { var req = init(); req.onreadystatechange = processRequest; function init() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else if (window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); } } function processRequest () { if (req.readyState == 4) { if (req.status == 200) { if (callback) callback(req.responseXML); } } } this.doGet = function() { req.open("GET", url, true); req.send(null); } this.doPost = function(body) { req.open("POST", url, true); req.setRequestHeader("Content-Type", " application/x-www-form-urlencoded"); req.send(body); } }

function makeRequest() { var ai = new AJAXInteraction("processme", function() { alert("Post Processing is going on");}); ai.doGet(); } Above we use function to makeRequest() to create an AJAXInteraction with a URL to of "processme" and their is an inline function which is use to show alert dialog with the message "Post Processing is going on". When we called ai.doGet() function than the Ajax interaction is initiated and when server-side component mapped to the URL "processme" returns a document and we passed them to the callback function that was specified when the Ajax Interaction was created.We use callback function that is associated with a specific AJAX interaction.When we creating multiple closure objects in that make XmlHttpRequests as to there is a limited number of sockets that are used to make requests at any given time.We can made concurrently with the limited number of requests. In internet explorer at any given time allows for two concurrent Ajax requests. Generally,In case of other browsers we can allow more than three and five requests. Keep in mind when you making multiple AJAX calls from the client than their is no guaranty to return rspose at given order. Ques: 40 What Ajax framework do you recommend for PHP applications? Ans: Prototype Ans: Prototype

Page 3
Ques: 41 Tell me reason of using HTTP POST request by Ajax requests? Ans: Suppose that if you want to check whether an email address xyz@abc.com is used already or not with Ajax,because url doesn't supports character "@" in email addresses directly.so, we have to use HTTP POST. Ques: 42 Explain about the Response time when we are using Ajax? Ans: Response time: We can also known response time as latency.WE can dscribe response time as the interval between the time taken to process the request generated from the client on the server. Delay has been come when proper handling of the XMLHttprequestobject occour between the client and server request. Ques: 43 Explain how Ajax is friendly with SEO? Ans: Because Ajax is a combination of many languages like: JavaScript,CSS etc. I have given you reason why Ajax is not so freindly with search engine indexing because much part of its code are written in JavaScript. So,Ajax may occur some problem websites have present dynamic data present.Generally, Search engines generally not to use index Javascript present in web pages. Ques: 44 Tell me about multimedia functions of Ajax? Ans: Basically, Ajax has no facility of build-in multimedia function But it it can uses functionality of other browsers and plugin`s such as SVG, Quicktime and flash pugin.We can achieve multimedia in Ajax through mashup and hack.

Multimedia functions are help us to build excellent application. We can obtain these multimedia functions from outside. Ques: 45 Tell me about direct ajax frameworks? Ans: If you want to use direct Ajax frameworks, Than you must require CSS, HTML and Ajax expertise. We should done authoring in HTML and the Ajax framework will deals with HTML elements directly . Ajax provide us many frameworks and API`s for many purposes like that commonly including functions(COM), event handling, DOM, and altering graphic rich elements. We can use these frameworks for shopping frameworks, But don't use this framework for applications which are based on web. Ques: 46 Tell me about Ajax component frameworks provides? Ans: I have given you some features that are provided by ajax component frameworks.These features are: 1.Cusomization Applications 2.skinning facilities 3.extensibility 4.programmatic control. Above these functions are a bit slower in execution(with less control). Ques: 47 Explain the disadvantage of Ajax.Which related to browser integration? Ans: When we created dynamic pages using Ajax than these pages doesn't back button(we use this button to go on previous pages. There are many ways to solve above problem.I have given you one of the best method called iframe to solve this problem. We can also bookmark a certain application in its state. Because User can also maintain the applications as changes the state of application. Ques: 48 Explain about security of the Ajax based web applications? Ans: We want to confirm that XMLHttpRequest object is subjected to the browsers security sandbox.When we requested about resources by the XMLHttpRequest object and it must reside within the same domain from which the calling script originated from which the calling script requested. In XMLHttpRequest we can't requested for services due to security restriction,outside the domain(from which the script was originally served). Ques: 49 How to send an image using Ajax? Ans: Yes, you can send an image with Ajax. Like that Google Maps.As per Ajax request Urls of images send as the response and we can set those URLs using DHTML. Example: Tn this example an XML document is returned from an AJAX. <categories> <category> <cat-id>001</cat-id> <name>IT</name> <description>Improve your skill</description> <image-url>IT_image.gif</image-url> </category> <category> <cat-id>002</cat-id> <name>Mathematics</name> <description>Solve problem easily</description> <image-url>mathematics.gif</image-url>

</category> </categories> We use image-url element to contain the location of the URL.The callback method that we used in AJAX interaction will parse the response XML document and call the addCategory function. The addCategory function looks up a table row element "categoryTable" in body of the page and adds a row to the element that is use to contains the image. <scrip type="text/javascript" > ... function addCategory(id, name, imageSrc) { var categoryTable = document.getElementById("categoryTable"); var row = document.createElement("tr"); var catCell = document.createElement("td"); var img = document.createElement("img"); img.src = ("images\" + imageSrc); var link = document.createElement("a"); link.className ="category"; link.appendChild(document.createTextNode(name)); link.setAttribute("onclick", "catalog?command=category&catid=" + id); catCell.appendChild(img); catCell.appendChild(link); row.appendChild(catCell); categoryTable.appendChild(row); } </script> ... <table> <tr> <td width="300" bgoclor="lightGray"> <table id="categoryTable" border="0" cellpadding="0"></table> </td> <td id="body" width="100%">Body Here</td> </tr> </table> source of the image is set to the image source. And we can load the image using a subsequent HTTP request for the image at the URL. "images/IT_image.gif" or "images/Mathematics.gif" This will occur when you add the image in the categoryTable. Ques: 50 Do Ajax applications always deliver a better experience than traditional web applications? Ans: Ajax made interaction designers more flexibility. However, the more power we have, the more caution we must use in exercising it. You should careful when you use Ajax to enhance the client experience of our applications. Ques: 51 Why we use SOAP? Ans: transfer the data

You might also like