Why Register With OSV?

Join 5700+ of your peers

Get enriched. Access 1270+ quality tutorials right away on:

  • Joomla 2.5.X, 3.0.X
  • WordPress 3.5.X
  • Shopping Carts
  • E-Commerce Payment Gateways
  • PDFs for each tutorial - FREE for download
  • New topics and tutorials added weekly

FREE EBooks

FREE Templates

Member Login

Not a member yet? Sign Up!

Opensourcevarsity Logo
Tutorials & Training from experienced world class trainers
Welcome, Guest
Username Password: Remember me

Internationalized AJAX interactions
(1 viewing) (1) Guest
All your queries regarding AJAX will be solved in this forum.
  • Page:
  • 1

TOPIC: Internationalized AJAX interactions

Internationalized AJAX interactions 10 months, 2 weeks ago #1138

  • prasad
  • OFFLINE
  • Junior Boarder
  • Posts: 29
  • Karma: 0
Can anyone tell me how to provide internationalized AJAX interactions?

Re: Internationalized AJAX interactions 10 months, 2 weeks ago #1139

  • patrica
  • OFFLINE
  • Senior Boarder
  • Posts: 68
  • Karma: 0
To provide internationalized AJAX components you need to do the following:

* Set the charset of the page to an encoding that is supported by your target languages. I tend to use UTF-8 because it covers the most languages. The following meta declaration in a HTML/JSP page will set the content type:

<m-eta http-equiv=""Content-Type"" content=""text/html; charset=UTF-8"">
* In the page JavaScript make sure to encode any parameters sent to the server. JavaScript provides the escape() function which returns Unicode escape strings in which localized text will appear in hexadecimal format. For more details on JavaScript encoding see Comparing escape(), encodeURI(), and encodeURIComponent().
* On the server-side component set the character encoding using the HttpServletRequest.setCharacterEncoding() method. Before you access the localized parameter using the HttpServletRequest.getParameter() call. In the case of UTF this would be 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>"");

For more information on using AJAX with Java Enterprise Edition technologies see AJAX and Internationalization and for developing multi-lingual applications see Developing Multilingual Web Applications Using JavaServer Pages Technology.

Some of the Google examples you cite don’t use XML at all. Do I have to use XML and/or XSLT in an Ajax application?
No. XML is the most fully-developed means of getting data in and out of an Ajax client, but there’s no reason you couldn’t accomplish the same effects using a technology like JavaScript Object Notation or any similar means of structuring data for interchange.
  • Page:
  • 1
Time to create page: 1.17 seconds
O-S-V Free Templates

FREE HTML / Joomla / WordPress Templates For Download
Registration Required

CONNECT WITH US

Sitemap   |   Privacy Policy   |   MySQL(70)   |   Disclaimer   |   Reach Out To Us
Designed by Ivan Bayross & Meher Bala | Powered by Joomla
© 2013 All Rights Reserved.