Skip to content

Commit

Permalink
Added optional parameter for turning off console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
johnpapa committed May 15, 2012
1 parent 23a9418 commit f156e46
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions js/jquery.mockjson.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $.mockJSON = function(request, template) {
};

$.mockJSON.random = true;

$.mockJSON.log = true;

var _original_ajax = $.ajax;
$.ajax = function(options) {
Expand Down Expand Up @@ -115,8 +115,10 @@ function getRandomData(key) {
var params = key.match(/\(([^\)]+)\)/g) || [];

if (!(key in $.mockJSON.data)) {
console.log(key);
console.log(params);
if ($.mockJSON.log) {
console.log(key);
console.log(params);
}
return key;
}

Expand Down

1 comment on commit f156e46

@asyncanup
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Please sign in to comment.