【问题标题】:Translate google谷歌翻译
【发布时间】:2012-12-21 11:53:40
【问题描述】:

问题是,当我选择一种语言时,我会用谷歌搜索打开的乐队。这是我的代码:

<! - Begin TranslateThis Button ->

<div id="translate-this">
    <a href="http://translateth.is/" class="translate-this-button">
    <img src = ".. / modules / traduireshop / images / FR. jpg "alt =" "style =" border: 0 "/>
    </ a>
</ div>
<script type="text/javascript" src="http://www.google.com/jsapi"> </ script>
<script type="text/javascript" src="http://x.translateth.is/translate-this.js"> </ script>
<script type="text/javascript">
    // javascript - see below
</ script>

<! - End TranslateThis Button ->

我的网站地址是:http://www.lecoindesvelos.com

TranslateThis ({
    undoText: 'Undo', '
    panelText 'Translate Into:'
    moreText: More Languages ??'36 "'
    busyText: 'Translating page ...'
    CancelText: 'cancel',
    ddLangs: [
        'fr',
        'en',
        'of'
        'it'
        'es',   
    ],
    noBtn: true
});

你能告诉我哪里有问题吗?
我想要更多的乐队。

【问题讨论】:

  • 您在对象语法中遗漏了许多引号和逗号。

标签: javascript button google-translate


【解决方案1】:

您的对象的语法不正确,请尝试以下操作:

TranslateThis({
    undoText: 'Undo',
    panelText: 'Translate Into:',
    moreText: "More Languages '36'",
    busyText: 'Translating page ...',
    CancelText: 'cancel',
    ddLangs: [
        'fr',
        'en',
        'of',
        'it',
        'es'
    ],
    noBtn: true
});

另外,您错误地关闭了一些 html 标签:

    </ a>
</ div>

应该是:

    </a>
</div>

最后,这些 HTML cmets 缺少一些破折号:

<! - Begin TranslateThis Button ->

试试这个:

<!-- Begin TranslateThis Button -->

【讨论】:

  • 语法在我的网站上一样好问题主要是出现的谷歌工具栏。
【解决方案2】:

在创建对象时,您有不匹配的引号和缺少逗号。正确的代码应该是:

<script type="text/javascript">
    TranslateThis ({
        undoText: 'Undo', //removed a quote
        panelText: 'Translate Into:', //added a colon after key and added comma
        moreText: 'More Languages (36)', //removed unmatched quote, added comma
        busyText: 'Translating page ...', //added comma
        CancelText: 'cancel', 
        ddLangs: [
            'fr',
            'en',
            'of', //added comma
            'it', //added comma
            'es' //removed comma - it's the end of the array, so no need
        ],
        noBtn: true
    });
</script>

【讨论】:

  • 你的代码不起作用 moreText bad syntax 小部件不再打开 我的问题主要是 google 横幅打开了。
【解决方案3】:

“翻译此”按钮的服务http://translateth.is 似乎已关闭。在该站点上运行的演示也无法运行。

Firebug 显示您的网站尝试访问 http://85.17.190.170:9013/socket.io/1/?t=1356094015380,但没有响应。

另外,你的问题不完整:

问题是,当我选择一种语言时,我会用 Google 搜索那个乐队 打开。

当您选择一种语言时会发生什么情况?你说你“谷歌打开的乐队”;你的意思是你对打开的乐队进行谷歌搜索吗? (我猜不是,我只是在这里猜测)。 还是您的意思是您希望看到更多的语言列表?

【讨论】:

  • 通过点击我谷歌打开的 iframe 语言的标志。
  • 对不起,我不明白你的意思。 (Tu pourrais décrire le problème en Français ?)
猜你喜欢
  • 1970-01-01
  • 2011-12-26
  • 2015-05-19
  • 1970-01-01
  • 2021-12-06
  • 2012-09-14
  • 2010-10-10
  • 1970-01-01
相关资源
最近更新 更多