Hi there,
I got a really annoying problem. The thing is that I want to translate
the content within a DIV to other languages, so I modified the script
a bit. It works great as long as I have my text without html tags, but
as soon as I add a <p> it stops to work. This seems like a simple
problem, but I can“t see where the problem is.
// Code that is triggered through translation link.
// lang : the language to be translated to
// translationText :the div that contains the translation text
// translatedText : the div that shall contain the translated text
google.language.translate(document.getElementById
("translationText").innerHTML.toString(), "", lang, function(result) {
if (!result.error) {
document.getElementById("translatedText").innerHTML =
result.translation;
}
})
<div id="translatedText" ><%= CurrentPage["MainBody"] %></div>
<div id="translationText" style="display:none"><%= CurrentPage
["MainBody"] %></div>
Thanks for your help!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---