tags:

views:

42

answers:

3

I am recently working in a project. There I need to convert language from English to Japanese by button click event. The text is in a div. Like this:

"<div id="sampletext"> here is the text </div>"
"<div id="normaltext"> here is the text </div>"

The text is come from database. How can I convert this text easily?

+1  A: 

A combination of AJAX and JQuery should do the trick.

  • AJAX - Go to the database and get the relevant text string
  • JQuery - Change the text in the div, identifying it by class.
DeletedAccount
A: 

Easily? I think not.

You'd need some kind of Javascript to grab the value of the div, then send it to a server-side script where it can be translated.

Jason
A: 

You could use the Google API to get google translations. But you would still need to do some AJAX like Nath suggested.

peirix