What is Ajax?
|
- 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 characteristics of existing page.
- Using Ajax we can enhance interactive animation on web pages.
- Using Ajax we can create better,faster and more user friendly web applications.
|
Whar you understand by Ajax Polling?
|
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.
|
Tell me reasons of using HTTP POST request by Ajax request?
|
How to use an Ajax code across different browsers?
|
Internet Explorer uses an ActiveXObject while other browsers uses the built-in 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> |
Why Ajax is comfortable fit with Java?
|
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. |
Tell me about environment that we used in Ajax?
|
Ajax support many environment like that PHP/ASP and other web based projects.
|
Uploading file using Ajax is possible or not?
|
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. |
How we can say user interfaces are powerful in Ajax?
|
How you define JSON in Ajax?
|
Some main points about JSON are given below:
JSON stand for JavaScript Object Notation. JSON is an lightweight data interchange format. JSOn gives us JavaScript eval() method to parse an XML easily. |
How you define Comet in Ajax? |
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 on the server,without any frequent polling.
|
What types of technologies combined in Ajax?
|
For implementation Ajax combined client side technologies. Technologies that are combined in Ajax are given below.
- JavaScript
- DHTML
- HTML
|
How to handle asynchronous processing using Ajax? |
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. Using 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. |
How you define Mashups in Ajax?
|
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. |
How you differenciate b/w DOM Parser and AUX Parser?
|
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.
|
Who is the discoverer of Ajax?
|
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). |
Tell me about different frameworks that are available in Ajax?
|
What happen when server to interact with an Ajax client?
|
How to submit a form or part of a form without refresh the page?
|
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=\"3\" /><input type=\"hidden\" name=\"phpMyAdmin\" value=\"2\" /> <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=\"2\" /><input type=\"hidden\" name=\"phpMyAdmin\" value=\"1\" /> <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.
|
How we get XMLHttpRequest object?
|
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\"); } |
What are security issues with Ajax?
|
Some main security issues regarding 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. |
What Ajax makes a \"new\" approach when we have tchniques for asyncronous server communication already?
|
We use asynchronous server communication 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. |
How we perform task to send an image using Ajax?
|
How can we compare HTML_AJAX with XAJAX project at Sourceforge?
|
Why HTML_AJAX server will hang when we install some server?
|
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 when you 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 .
|
How Ajax applications are much easier to develop as compare to traditional web applications?
|
Generally, Ajax applications necessarily used to running complex JavaScript code on the client side.If you want that your complex code efficient and bug-free. 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. |
How do I provide internationalized AJAX interactions?
|
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>\");
|
What you understand exactly with W3C DOM?
|
What you understand about applets and plugins?
|
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.
|
Tell me Ajax is just another name for XMLHttpRequest or not? |
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.
|
Should I use an HTTP GET or POST for my AJAX calls?
|
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 retrieved 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 impotency recommendations and both are highly recommended for a consistent web application architecture.
|
What the main difference b/w Client-Side JavaScript and Server-Side JavaScript?
|
I have given you some main difference b/w Client-Side JavaScript and Server-Side JavaScript that are given below:
1. Client-Side JavaScript covers the core language plus some other like that predefined objects, only relevant to running JavaScript 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 JavaScript in a server.
2. We can embedded Client-Side JavaScript in the HTML pages directly and this can complexly interpreted by browser at run time.Where as we compiled Server-Side JavaScript are compiled before to deployed them.
|
How to differenciate proxied and proxyless calls?
|
The main difference b/w peroxided and proxy less are given below: 1.Peroxided calls: We made Peroxided 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.Proxy-less calls: We can made the peroxided calls using utility JavaScript functions like: HTML_AJAX.replace() HTML_AJAX.append()
|
What\'s the main purpose of Ajax? |
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 increase 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.
|
What is the main difference b/w Ajax and JavaScript?
|
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.
|
What is the back ground work going on when you type www.R4R.co.in in your web browser?
|
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.
|
What are the limitations of Ajax?
|
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.Because 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 occurs because of which type of events. connections may reduce usability if not carefully designed to accommodate both fast and slow network characteristics. |
Write down different framework available in Ajax?
|
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. |
How I create my own AJAX functionality?
|
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.
|
How to handle te concurrent Ajax request?
|
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. |
What Ajax framework do you recommend for PHP applications?
|
Prototype
|
Tell me reason of using HTTP POST request by Ajax requests?
|
Suppose that if you want to check whether an email address xyz@r4r.co.in is used already or not with Ajax,because url doesn\'t supports character \"@\" in email addresses directly.so, we have to use HTTP POST. |
Explain about the Response time when we are using Ajax? |
Response time: We can also known response time as latency.
We can describe 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 occur between the client and server request. |
Explain how Ajax is friendly with SEO?
|
Because Ajax is a combination of many languages like: JavaScript,CSS etc. I have given you reason why Ajax is not so friendly 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. |
Tell me about multimedia functions of Ajax?
|
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. |
Tell me about direct ajax frameworks? |
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.
|
Tell me about Ajax component frameworks provides?
|
I have given you some features that are provided by ajax component frameworks.
These features are:
1.Customization Applications 2.skinning facilities 3.extensibility 4.programmatic control. Above these functions are a bit slower in execution(with less control). |
Explain the disadvantage of Ajax.Which related to browser integration?
|
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. |
Explain about security of the Ajax based web applications? |
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).
|
How to send an image using Ajax?
|
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. |
Do Ajax applications always deliver a better experience than traditional web applications?
|
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. |
Why we use SOAP?
|
transfer the data |
Which Protocol is used by Web service and Web service consumer to communicate with each other ?
|
HTTP |