我有src的image属性.我想知道当我从服务器删除图像时它应该显示alt属性中不存在的图像.否则它应该显示图像.我正在测试这个警报,但不知道使用哪个关键字.
<head>
<script type="text/javascript">
$(function(){
alert($('img').attr('src'))
})
</script>
</head>
<body>
<img src="http://cdn1.iconfinder.com/data/icons/momenticons-gloss-basic/momenticons-gloss-basic/32/information2.png" />
</body>
Run Code Online (Sandbox Code Playgroud) 当我运行此函数时,该值显示为26.我想知道系统使用什么计算以及它为什么评估为26.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>parseint</title>
<script type="text/javascript">
var par= "1a";
alert (parseInt(par,16))
</script>
</head>
<body>
</body>
</html>
Run Code Online (Sandbox Code Playgroud) 我想要警报对象key名称及其value.但它没有用.
$(function() {
var james = {first: '1,2,3', second: '4,5,6' }
$('a').click(function(){
alert(james[first])
})
})
Run Code Online (Sandbox Code Playgroud)