无法让两个脚本一起工作 - 命名冲突 [英] cannot get two scripts to work together - naming conflicts

查看:53
本文介绍了无法让两个脚本一起工作 - 命名冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个相当简单的解决方案,但我对Java几乎一无所知。我正在尝试创建一个包含两行按钮的页面,我希望它们具有某种鼠标悬停效果。因此,我在free-buttons.org找到了一个程序,它一次只能生成一行按钮。它使用表格和javascript来制作每个水平的按钮组。当我只粘贴一组按钮时,操作完美。但是,当我将第二行按钮添加到页面时,会出现问题。我认为两个脚本中必定存在冲突,导致它们都失败。以下是我到目前为止所提出的建议:


--------------------------- --------

This is probably a rather easy fix, but I know next to nothing about java. I am attempting to create a page that has two rows of buttons, and I wanted to have some sort of mouseover effect on them. Therefore, I found a program at free-buttons.org that will make one row of buttons at a time. It uses tables and javascript to make each horizontal set of buttons. When I only paste in one set of buttons, the operation works perfectly. However, the problem occurs when I add the second row of buttons into the page. I think that there must be a conflict in the two scripts, causing them both to fail. Here is what I have come up with so far:

-----------------------------------

展开 | 选择 | Wrap | 行号

推荐答案

由于您已定义函数,因此发生冲突,具有相同名称的ID等。


在每行第三次调用时,wbpr还有一个空格。


在第二个脚本中:

删除函数wbpr和wbe

在调用函数时为id选择不同的名称,例如
The conflict occurs because you have defined functions, ids, etc. with the same names.

There is also a problem that wbpr has a space when called the third time on each line.

In the second script:
Delete the functions wbpr and wbe
Choose different names for the ids when calling the functions, e.g.
展开 | 选择 | Wrap | 行号


谢谢你的回复。我已经看过你提到的脚本部分,但我仍然无法让它们一起工作。我尝试在第二个脚本中删除wbpr和wbe函数,以及为id选择不同的名称。我还修复了间距错误。我最终得到了第二个脚本的以下代码:

Hey thanks for the reply. I''ve taken a look at the parts of the scripts you mentioned, but I still cannot get them to work together. I tried removing the wbpr and wbe functions in the second script, as well as choosing different names for the ids. I also fixed the spacing errors. I end up with the following code for the second script:

展开 | 选择 | Wrap | 行号


好的,我想,看完之后在更深入的代码中,您需要更改按钮的名称并保留功能。保留第一段代码来自免费按钮,您只需要更改第二段代码。


更改函数名称而不是删除它们,因为您需要它们可能会根据你的需要改变它们。
OK, I think, after looking at the code in more depth, you need to change the names of the buttons and keep the functions. Keep the first snippet of code from free-buttons as it is, you only need to change the second piece of code.

Change the function names instead of removing them, because you will need them but will probably alter them for your needs.
展开 | 选择 | Wrap | 行号


这篇关于无法让两个脚本一起工作 - 命名冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆