Ajax
04-11-2007, 12:40 PM
Hi,
I am new to Ajax. I have seen several Ajax tooltips javascript codes where you could have the tooltip display messages from external html file or xml file. But these examples display the whole text of the XML file instead of certain selected word.
What I wanted to do is having a tooltip to translate the content of my web page. Whenever the visitor point the mouse to certain word on my web page, the tooltip will display the definition of that word in a foreign language. This foreign language is stored in an external XML file e.g.
<german>schwarz</german>
<english>black</english>
<german>blau</german>
<english>blue</english>
<german>braun</german>
<english>brown</english>
If the visitor point the mouse to English word black on my web page, the tooltip will display the definition of the word in German.
Can this be done with plain javascript and html page or do I need to use a dynamic php page?
The Ajax tooltip codes I have seen at many websites are used on static html page. But these codes will display the whole XML content instead of selected word.
Someone told me that I have to work on getElementById and getElementsByTagName in order to display the selected XML word. But the bad news is I do not know how to do it.
I really appreciate if you could guide me or show me some working example source codes that I could work on.
Thank you very much for your help.
I am new to Ajax. I have seen several Ajax tooltips javascript codes where you could have the tooltip display messages from external html file or xml file. But these examples display the whole text of the XML file instead of certain selected word.
What I wanted to do is having a tooltip to translate the content of my web page. Whenever the visitor point the mouse to certain word on my web page, the tooltip will display the definition of that word in a foreign language. This foreign language is stored in an external XML file e.g.
<german>schwarz</german>
<english>black</english>
<german>blau</german>
<english>blue</english>
<german>braun</german>
<english>brown</english>
If the visitor point the mouse to English word black on my web page, the tooltip will display the definition of the word in German.
Can this be done with plain javascript and html page or do I need to use a dynamic php page?
The Ajax tooltip codes I have seen at many websites are used on static html page. But these codes will display the whole XML content instead of selected word.
Someone told me that I have to work on getElementById and getElementsByTagName in order to display the selected XML word. But the bad news is I do not know how to do it.
I really appreciate if you could guide me or show me some working example source codes that I could work on.
Thank you very much for your help.