Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Mar 2004
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Stop alert window after choosing OK ??

    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.
    And
    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?
    Thanks

    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.

    french
    spanish
    chinese
    japanese
    german
    dutch
    greek
    italian
    korean
    portuguese
    russian

    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....
    Last edited by ghoulardi; 06-18-2004 at 11:30 AM.

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    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':'')))
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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......

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    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.
    Unlike in Moz where it's unlimited.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #5
    New Coder
    Join Date
    Mar 2004
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!!!!!
    Last edited by ghoulardi; 06-18-2004 at 01:52 PM.

  • #6
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •