I'm using it on local server tomcat 5.0 So cannot use it. I have simply copy and paste the code of the sample of this api from google code playground and then created a jsp page to get the parameter value of the textarea.
Here is the code for loading the textarea. It is saved in .html format: ========== <!-- copyright (c) 2009 Google inc. You are free to copy and use this sample. License can be found here: http://code.google.com/apis/ajaxsearch/faq/#license --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/ > <title>Google AJAX Search API Sample</title> <script src="http://www.google.com/jsapi? key=ABQIAAAA1XbMiDxx_BTCY2_FkPh06RRaGTYH6UMl8mADNa0YKuWNNa8VNxQEerTAUcfkyrr6OwBovxn7TDAH5Q"></ script> <script type="text/javascript"> /* * How to setup a textarea that allows Transliteration from English to Hindi. */ google.load("elements", "1", {packages: "transliteration"}); function OnLoad() { var content = document.getElementById('content'); // Create the HTML for our text area content.innerHTML = '<div>Type a word and hit space to get it in Hindi. ' + 'Click on a word to see more options.</div>' + '<textarea cols="100" rows="5" id="transliterateTextarea"></textarea>' + '<div>Type in (do not copy/paste): ' + '<b>namaste main yahan apke madad karane ke liye hun</b></div>'; var options = { sourceLanguage: google.elements.transliteration.LanguageCode.ENGLISH, destinationLanguage: [google.elements.transliteration.LanguageCode.HINDI], shortcutKey: 'ctrl+g', transliterationEnabled: true }; // Create an instance on TransliterationControl with the required // options. var control = new google.elements.transliteration.TransliterationControl(options); // Enable transliteration in the textbox with id // 'transliterateTextarea'. control.makeTransliteratable(['transliterateTextarea']); } google.setOnLoadCallback(OnLoad); </script> </head> <body style="font-family: Arial;border: 0 none;"> <form action="test.jsp" > <div id="content">Loading... </div> <input type="submit" id="s" value="Update"/> </form> </body> </html> ============ and this is the .jsp file , where I want to get the textarea value: ============ <%...@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <% String tex=request.getParameter("eth"); out.println(tex); %> </body> </html> ============ Please tell me where is the problem. On Apr 14, 4:06 pm, Jeremy Geerdes <[email protected]> wrote: > Can you provide a link to the first page so we can play with the app to see > what's going on? Thanks. > > Jeremy R. Geerdes > Effective website design & development > Des Moines, IA > > For more information or a project quote:http://jgeerdes.home.mchsi.com > [email protected] > > If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan > Church! > > On Apr 14, 2010, at 4:21 AM, Abhi Handoo wrote: > > > Hi, > > > I'm trying to update whatever is being written into the text area into > > other jsp page. > > But I get as a result is this junk like > > "हेलॠलो " > > > I'm transliterating from english to hindi however not able to get the > > desired text. > > > The code at jsp is simple > > > String txt=request.getParameter("eth"); > > > out.println(txt); > > > Please help me out. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Google AJAX APIs" group. > > To post to this group, send email to > > [email protected]. > > To unsubscribe from this group, send email to > > [email protected]. > > For more options, visit this group > > athttp://groups.google.com/group/google-ajax-search-api?hl=en. -- You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-ajax-search-api?hl=en.
