View Full Version : Stop alert window after choosing OK ??

06-18-2004, 12:25 PM
Hi, Totaly new here.

I kinda have 3 things im asking help for....

I have this javascript I want to use in an IE toolbar that will Translate
the page your on to English (using altavista's Bablefish)
It pops up an alert box for each language hitting yes or cancel to choose.

How do I make the alert boxes stop poping up after you click OK on the
one you want? Otherwise you have to go through the rest of them hitting cancel. :(

Second, How or where do I put the window.open in there so it opens new.
If thats posible with this.
Could the javascript cause any problems being that it is that long? Should I cut some of the languages out? Its worked so far.

Anyone know?

Also, does someone want to list theese languages from most popular to least popular on the web? So I can put them in order. hehe.


javascript:void(location='http://babelfish.altavista.com/babelfish/trurl_load?url='+escape(location)+(confirm('Chi to Eng?')?'%2F&lp=ch_en':'')+(confirm('Jap to Eng?')?'%2F&lp=jp_en':'')+(confirm('Fre to Eng?')?'%2F&lp=fr_en':'')+(confirm('Esp to Eng?')?'%2F&lp=es_en':'')+(confirm('Rus to Eng?')?'%2F&lp=ru_en':'')+(confirm('Ger to Eng?')?'%2F&lp=de_en':'')+(confirm('Ita to Eng?')?'%2F&lp=it_en':'')+(confirm('Gre to Eng?')?'%2F&lp=el_en':'')+(confirm('Kor to Eng?')?'%2F&lp=ko_en':''))

Copy and paste it in IE to test, it works... :) But this page is in english already so uhh....

06-18-2004, 01:10 PM
javascript:void(window.open('http://babelfish.altavista.com/babelfish/trurl_load?url='+escape(location)+(confirm('Chi to Eng?')?'%2F&lp=ch_en':confirm('Jap to Eng?')?'%2F&lp=jp_en':confirm('Fre to Eng?')?'%2F&lp=fr_en':confirm('Esp to Eng?')?'%2F&lp=es_en':confirm('Rus to Eng?')?'%2F&lp=ru_en':confirm('Ger to Eng?')?'%2F&lp=de_en':confirm('Ita to Eng?')?'%2F&lp=it_en':confirm('Gre to Eng?')?'%2F&lp=el_en':confirm('Kor to Eng?')?'%2F&lp=ko_en':'')))

Willy Duitt
06-18-2004, 01:27 PM
Regardless of the order the selections appear. Unless my preference was first or second, I would find all of those confirms a nuisance. Therefore, I would suggest popping a custom alert which contained checkboxes to select......

06-18-2004, 01:41 PM
Or use a single prompt dialog with message like:

Press the corresponding code:
Chi to Eng - 1
Jap to Eng - 2
Fre to Eng - 3

The space is limited in IE prompt though. It can only accommodate 2 lines. :mad:
Unlike in Moz where it's unlimited.

06-18-2004, 02:42 PM
Yeah but how many times do you need to translate a webpage, and its not that many boxes really, but i see what you mean. If you could give me a better code Im all for it, but This is what I got and It works ehh.

I would like to make it a check box.

Thanks again Glenngv. You RULE!!!!!

Willy Duitt
06-18-2004, 02:48 PM
As long as your happy I suppose that is all that matters.
All I know is I would not click on that link more than once. ;)