试图从循环中删除多余的单词,例如'each','all','collect' [英] trying to remove extra words from loop, such as 'each', 'all', 'collect'
问题描述
如果你去 http://dante.acomp.usf .edu / HomeworkAssistant / index.php 你
会看到我的代码。
输入:
s = a + b和点击标签,你会看到额外的单词。
如何删除这些?
这是一个片段我的代码:
var myvalue = targ.value;
if(myvalue.indexOf(''='')> -1){
myvalue = myvalue.substring(myvalue.indexOf(''='')+ 1);
}
var elements = myvalue.split('''' );
var lastvariable;
var variables = [];
var s;
for(var t = 0; t< elements.length; t ++){
s = elements [t];
targ是输入标签的元素。
s是数组中的单词。
感谢您的帮助。
If you go to http://dante.acomp.usf.edu/HomeworkAssistant/index.php you
will see my code.
Type in:
s = a + b and hit tab, and you will see the extra words.
How do I remove these?
Here is a snippet of my code:
var myvalue = targ.value;
if(myvalue.indexOf(''='') > -1) {
myvalue = myvalue.substring(myvalue.indexOf(''='') + 1);
}
var elements = myvalue.split('' '');
var lastvariable;
var variables = [];
var s;
for(var t = 0; t < elements.length; t++) {
s = elements[t];
targ is the element of the input tag.
s is the words in the array.
Thank you for your help.
推荐答案
James Bl ack在下面的5/20/2006 11:42 PM说:
James Black said the following on 5/20/2006 11:42 PM:
如果你去 http://dante.acomp.usf.edu/HomeworkAssistant/index.php 你将看到我的代码。
输入:
s = a + b并点击标签,你会看到额外的单词。
If you go to http://dante.acomp.usf.edu/HomeworkAssistant/index.php you
will see my code.
Type in:
s = a + b and hit tab, and you will see the extra words.
所有我看到的是一个空白页面错误。
-
兰迪
comp.lang.javascript常见问题 - http://jibbering.com/faq &新闻组每周
Javascript最佳实践 - http://www.JavascriptToolbox .com / bestpractices /
All I see is a blank page with lots of errors.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Randy Webb写道:
Randy Webb wrote:
所有我看到的是一个包含大量错误的空白页。
All I see is a blank page with lots of errors.
现在它只适用于Firefox 1.5。
我忘记了提到这一点,因为我在那里使用DOM2,并且
导致IE6出现问题。
Right now it only works with Firefox 1.5.
I had forgotten to mention that, as I am using DOM2 in there, and
that causes problems with IE6.
James Black说以下是2006年5月21日下午4:08:
James Black said the following on 5/21/2006 4:08 PM:
Randy Webb写道:
Randy Webb wrote:
我看到的只是一个包含大量错误的空白页面。 />现在它只适用于Firefox 1.5。
All I see is a blank page with lots of errors.
Right now it only works with Firefox 1.5.
空白页面,错误在1.5.0.3
家庭作业不是定义
第二次重新加载页面使其变为半工作。
这里有99%的问题:
insertScriptTags(" prototype.js");
insertScriptTags(" scriptaculous.js");
该页面到底想要做什么呢?
我忘记提及,我在那里使用DOM2,并且导致IE6出现问题。
Blank page with errors in 1.5.0.3
Homework is not defined
Reloading the page a second time gets it to semi-work.
Here is 99% of your problems:
insertScriptTags("prototype.js");
insertScriptTags("scriptaculous.js");
What exactly is that page trying to do though?
I had forgotten to mention that, as I am using DOM2 in there, and
that causes problems with IE6.
好东西我没试过在IE6中看到它然后吧?
我得到的问题是:
一辆汽车以100英里/小时的速度向北行驶,朝火车方向行驶。火车正以5mpg向东移动
以东。火车长880码。这辆车需要行驶3000英镑才能上火车。汽车在哪里撞上火车?
答案是:在前面。
-
兰迪
comp.lang.javascript常见问题 - http://jibbering.com/常见问题&新闻组每周
Javascript最佳实践 - http://www.JavascriptToolbox .com / bestpractices /
Good thing I didn''t try to see it in IE6 then huh?
The question I got was:
A car is traveling north at 100 mph toward a train. The train is moving
east at 5mpg. The train is 880 yards long. The car needs to travel 3000
m to hit the train. Where does the car hit the train?
The answer is: In the front.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
这篇关于试图从循环中删除多余的单词,例如'each','all','collect'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!