'function canBe(el)' el не считается за функцию
function canBe(el) {
$('#canbe').html(array[el.attr('id')]);
}
и тут понеслась Uncaught TypeError: undefined is not a function что делать?! jquery подключён |
Konstantinov,
ie? |
Konstantinov,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
$(function() {
var array = {
2015: "всякая фигня"
};
function canBe(el) {
$("#canbe").html(array[el.attr("id")])
}
canBe($(".test"))
});
</script>
</head>
<body>
<span id="canbe"></span>
<span id="2015" class="test"></span>
</body>
</html>
|
| Часовой пояс GMT +3, время: 02:24. |