小编Dan*_*wen的帖子

Javascript数组的最大值并找到它的位置?

这里有javascript问题...

我需要找到数组中的最大数字,然后返回数组中此数字的位置.它无法排序,因为它需要与另一个数组中的单词匹配.继承阵列:

var array1 = dan, john, james, harry, mike;
var array2 = 66, 33, 85, 34, 45;
Run Code Online (Sandbox Code Playgroud)

基本上这个数字必须与它已经拥有的名称相匹配.如果有人有答案我会很高兴:)

谢谢

javascript arrays numbers max

3
推荐指数
1
解决办法
3629
查看次数

无法让jQuery在本地工作

嘿,我已经检查了更多这样的jQuery问题而不是我记得,但我似乎无法弄明白这一点.

以下代码不会在本地工作.还没有机会在线测试,但我当然应该可以在本地进行测试.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang='en' xml:lang='en' xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>jQuery test</title>
    <link rel='stylesheet' type='text/css' href='/root/WebDev/jquery-ui-1.10.2.custom/css/ui-lightness/jquery-ui-1.10.2.custom.min.css'/>
  <script type="text/javascript" src="jquery.js"></script>
  <script type="text/javascript" src="/root/WebDev/jquery-ui-1.10.2.custom/js/jquery-1.9.1.js"></script>
  <script type="text/javascript" src="/root/WebDev/jquery-1.9.1.min.js"></script>
</head>
<body>

    <div style="height: 20px;width:20px;background-color:red;position:relative;top:50px;left:50px;"></div>
</body>
Run Code Online (Sandbox Code Playgroud)

和jQuery代码:

$(document).ready(function(){
$('div').click(function(){
    $('div').effect('explode');
});

});
Run Code Online (Sandbox Code Playgroud)

就像一个注释,我确实在本地有那些jquery文件.

javascript jquery user-interface load

2
推荐指数
1
解决办法
5792
查看次数

标签 统计

javascript ×2

arrays ×1

jquery ×1

load ×1

max ×1

numbers ×1

user-interface ×1