IT Community - Software Programming, Web Development and Technical Support

Ajax Interview Question

This is a discussion on Ajax Interview Question within the C# Programming forums, part of the Software Development category; Is the server or the client in control in AJAX? It depends. With AJAX the answer is more in between. ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 09-01-2007, 12:27 AM
Sundaram Sundaram is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Location: chennai
Posts: 117
Sundaram is on a distinguished road
Send a message via MSN to Sundaram Send a message via Yahoo to Sundaram
Default Ajax Interview Question

Is the server or the client in control in AJAX?

It depends. With AJAX the answer is more in between. Control can be more centralized in a server-side component or as a mix of client-side and server-side controllers.
Centralized server-side controller - When having a more centralized controller the key is to make sure the data in client-side page is in sync with that of the server. Some applications may keep all the state on the server and push all updates to client DOM via a simple JavaScript controller.
Client and server-side controllers - This architecture would use JavaScript to do all presentation related control, event processing, page manipulation, and rendering of model data on the client. The server-side would be responsible for things such as business logic and pushing updated model data to the client. In this case the server would not have intimate knowledge of the presentation short of the initial page that would be sent to the client page request.
There are some use cases where an entire AJAX application can be written in a single page. Keep in mind if you choose this type of architecture that navigation and bookmarking should be considered.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-01-2007, 12:28 AM
Sundaram Sundaram is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Location: chennai
Posts: 117
Sundaram is on a distinguished road
Send a message via MSN to Sundaram Send a message via Yahoo to Sundaram
Default How can I call a Java method from Javascript?

AJAX is not a new technology but a combination of several existing technologies in a new way. These include HTML, CSS, DOM, XML, XSLT, XMLHttpRequest and Javascript. The acronym AJAX stands for Asynchronous Javascript and XML. AJAX is based on open standards supported by many browsers and platforms. AJAX is a new paradigm for building web application.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-01-2007, 12:29 AM
Sundaram Sundaram is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Location: chennai
Posts: 117
Sundaram is on a distinguished road
Send a message via MSN to Sundaram Send a message via Yahoo to Sundaram
Default Which browsers support AJAX?

Internet Explorer 5.0 and up, Opera 7.6 and up, Netscape 7.1 and up, Firefox 1.0 and up, Safari 1.2 and up, among others.

Last edited by Sundaram : 09-01-2007 at 12:32 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-01-2007, 12:31 AM
Sundaram Sundaram is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Location: chennai
Posts: 117
Sundaram is on a distinguished road
Send a message via MSN to Sundaram Send a message via Yahoo to Sundaram
Default Is there any way that an AJAX object can get back a record set?

You could build an XML document out of your recordset and send that back to the server, say you had a redord set for a “user” with the following details (name, surname, age, email), you could build an xml document like this:

Code:


Murugan
sundaram
25
sundarsri08@gmail.com


Sree
Raj
39
sundarsri08@yahoo.co.in



You can add as many records as you have in your recordset, then once the client has received it you can use javascript to iterate over the ’s in the xml.

Last edited by Sundaram : 09-18-2007 at 09:55 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 09-01-2007, 12:33 AM
Sundaram Sundaram is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Location: chennai
Posts: 117
Sundaram is on a distinguished road
Send a message via MSN to Sundaram Send a message via Yahoo to Sundaram
Default What are the different frameworks available In AJAX?

A good framework is “Zephyr”.
It is used with php and seems to be very easy to use.
Prototype.JS Framework is available with detailed documentation, its very easy to handle AJAX and JavaScript, Introduce $ concept its very simple, For Ajax specially u don’t need to check cross browser, Open, Close and error handling through traditional AJAX.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 09-01-2007, 12:33 AM
Sundaram Sundaram is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Location: chennai
Posts: 117
Sundaram is on a distinguished road
Send a message via MSN to Sundaram Send a message via Yahoo to Sundaram
Default Who invented AJAX?

Microsoft first implemented the XMLHTTPRequest object in Internet Explorer 5 for Windows as an ActiveX object. It is the term coined after this support.
Asynchronous javascript and XML. Nobody invented AJAX, Jesse James Garrett of Adaptive Path coined the phrase early 2005 - but the tech was already in place much earlier than that
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 09-01-2007, 12:34 AM
Sundaram Sundaram is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Location: chennai
Posts: 117
Sundaram is on a distinguished road
Send a message via MSN to Sundaram Send a message via Yahoo to Sundaram
Default Does Java have support for Comet style server-side push?

Current AJAX applications use polling to communicate changes data between the server and client. Some applications, such as chat applications, stock tickers, or score boards require more immediate notifications of updates to the client. Comet is an event based low latency server side push for AJAX applications. Comet communication keeps one of the two connections available to the browser open to continuously communicate events from the server to the client.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 09-01-2007, 12:35 AM
Sundaram Sundaram is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Location: chennai
Posts: 117
Sundaram is on a distinguished road
Send a message via MSN to Sundaram Send a message via Yahoo to Sundaram
Default Are there any security issues with AJAX?

JavaScript is in plain view to the user with by selecting view source of the page. JavaScript can not access the local filesystem without the user’s permission. An AJAX interaction can only be made with the servers-side component from which the page was loaded. A proxy pattern could be used for AJAX interactions with external services.

You need to be careful not to expose your application model in such as way that your server-side components are at risk if a nefarious user to reverse engineer your application. As with any other web application, consider using HTTPS to secure the connection when confidential information is being exchanged
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 09-01-2007, 12:36 AM
Sundaram Sundaram is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Location: chennai
Posts: 117
Sundaram is on a distinguished road
Send a message via MSN to Sundaram Send a message via Yahoo to Sundaram
Default Should I use an HTTP GET or POST for my AJAX calls?

AJAX requests should use an HTTP GET request when retrieving data where the data will not change for a given request URL. An HTTP POST should be used when state is updated on the server. This is in line with HTTP idempotency recommendations and is highly recommended for a consistent web application architecture
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 09-01-2007, 12:37 AM
Sundaram Sundaram is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Location: chennai
Posts: 117
Sundaram is on a distinguished road
Send a message via MSN to Sundaram Send a message via Yahoo to Sundaram
Default Does AJAX work with Java?

Yes, Java is a great fit for AJAX! You can use Java Enterprise Edition servers to generate AJAX client pages and to serve incoming AJAX requests, manage server side state for AJAX clients, and connect AJAX clients to your enterprise resources. The JavaServer Faces component model is a great fit for defining and using AJAX components.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 09-01-2007, 12:37 AM
Sundaram Sundaram is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Location: chennai
Posts: 117
Sundaram is on a distinguished road
Send a message via MSN to Sundaram Send a message via Yahoo to Sundaram
Default What is AJAX?

Ajax is an acronym for “Asynchronous JavaScript And XML.” Web pages are endowed with snippets of code that can access remote services (like web services) and not refresh the page. This prevents “round tripping” which is the cause for display flicker and slow response times.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 12-03-2007, 10:35 PM
sathian sathian is offline
D-Web Analyst
 
Join Date: Aug 2007
Posts: 252
sathian is on a distinguished road
Default Re: Ajax Interview Question


Is the server or the client in control in AJAX?


It depends. With AJAX the answer is more in between. Control can be more centralized in a server-side component or as a mix of client-side and server-side controllers.

Centralized server-side controller - When having a more centralized controller the key is to make sure the data in client-side page is in sync with that of the server. Some applications may keep all the state on the server and push all updates to client DOM via a simple JavaScript controller.
Client and server-side controllers - This architecture would use JavaScript to do all presentation related control, event processing, page manipulation, and rendering of model data on the client. The server-side would be responsible for things such as business logic and pushing updated model data to the client. In this case the server would not have intimate knowledge of the presentation short of the initial page that would be sent to the client page request.

There are some use cases where an entire AJAX application can be written in a single page. Keep in mind if you choose this type of architecture that navigation and bookmarking should be considered.

Thanks
Sathian.K
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 12-03-2007, 10:37 PM
sathian sathian is offline
D-Web Analyst
 
Join Date: Aug 2007
Posts: 252
sathian is on a distinguished road
Default Re: Ajax Interview Question

How can I call a Java method from Javascript?

Direct Web Remoting is an open source Java library which allows for easy integration of AJAX into your web site. It allows you to call Java methods directly from Javascript.

Thanks
Sathian.K
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 12-03-2007, 10:38 PM
sathian sathian is offline
D-Web Analyst
 
Join Date: Aug 2007
Posts: 252
sathian is on a distinguished road
Default Re: Ajax Interview Question

Who invented AJAX?

Microsoft first implemented the XMLHTTPRequest object in Internet Explorer 5 for Windows as an ActiveX object. It is the term coined after this support.

Asynchronous javascript and XML. Nobody invented AJAX, Jesse James Garrett of Adaptive Path coined the phrase early 2005 - but the tech was already in place much earlier than that

Thanks
Sathain.K
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 12-03-2007, 10:40 PM
sathian sathian is offline
D-Web Analyst
 
Join Date: Aug 2007
Posts: 252
sathian is on a distinguished road
Default Re: Ajax Interview Question

Are there any security issues with AJAX?

JavaScript is in plain view to the user with by selecting view source of the page. JavaScript can not access the local filesystem without the user’s permission. An AJAX interaction can only be made with the servers-side component from which the page was loaded. A proxy pattern could be used for AJAX interactions with external services.

You need to be careful not to expose your application model in such as way that your server-side components are at risk if a nefarious user to reverse engineer your application. As with any other web application, consider using HTTPS to secure the connection when confidential information is being exchanged

Thanks
Sathian.K
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #16 (permalink)  
Old 12-03-2007, 10:41 PM
sathian sathian is offline
D-Web Analyst
 
Join Date: Aug 2007
Posts: 252
sathian is on a distinguished road
Default Re: Ajax Interview Question

What are the different frameworks available In AJAX?

A good framework is “Zephyr”.
It is used with php and seems to be very easy to use.
Prototype.JS Framework is available with detailed documentation, its very easy to handle AJAX and JavaScript, Introduce $ concept its very simple, For Ajax specially u don’t need to check cross broswer, Open, Close and error handling through traditional AJAX.

Thanks
Sathian.K
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to use ajax in asp.net and how to install ajax in my system vel.m8 ASP and ASP.NET Programming 5 04-08-2008 08:55 PM
Mac OS X question ventyra Operating Systems 1 12-17-2007 08:48 PM
AJAX Interview FAQ Sabari Interview Questions & Answers and Tips 77 11-23-2007 08:51 AM
Interview question on Software testing vadivelanvaidyanathan Interview Questions & Answers and Tips 13 09-04-2007 12:18 AM
when i load the tpl file using ajax it displays question mark(?) for   .How to o ramkumaraol PHP Programming 1 08-03-2007 03:11 AM


All times are GMT -7. The time now is 10:45 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0