I run this code here
<html>
<script type="text/javascript" src="lib/jquery-ui-1.8.21.custom.min.js"></script>
<script src="http://127.0.0.1:5984/_utils/script/jquery.couch.js"></script>
<!--<script type="text/javascript" src="lib/jquery-1.7.2.js"></script>-->
<script>
<!--var dbc = $.jqCouch.connection('db');-->
<!--dbc.exists('database_name');-->
<!--if ($.jqCouch.connection('db').create('database_name').ok) {-->
<!--alert("database created");-->
<!--}-->
$.couch.activeTasks({
success: function (data) {
console.log(data);
}
});
</script>
</html>
and I get the error. I have tried with all kind of jQueries such as everything with UI -custom and the 1.72 as you can see in the code. So why do I get this error? And where can I find which jQuery is needed to use the CouchJS?
Puzzles
Perhaps useful to other beginners with CouchDB
You need to load jQuery before,
jQuery UIorCouch JSbecause they both uses$variable inside those files, andjQuery.jsdefines that$as an alias to thejQueryobject. So$has to be defined first before being used. So change your code to thisAnd it should Work fine.
For production websites I would recommend loading jQuery from a CDN( You can do a quick google search to find the benefits of using CDN for jQuery if you dont already know) like