Permalink
Browse files

make JSLint compatible

  • Loading branch information...
1 parent 73812a0 commit 02d2c40d5db7573cb91bb3acf3de29c0220016c2 Kyo Nagashima committed Dec 13, 2011
Showing with 15 additions and 12 deletions.
  1. +15 −12 jquery.query-yql.js
View
27 jquery.query-yql.js
@@ -1,11 +1,15 @@
-/*!
- * jQuery Plugin: Query YQL - version 0.3.1
- * http://github.com/hail2u/jquery.query-yql
- * Query YQL simply.
+/**
+ * @preserve jQuery Plugin: Query YQL - version 0.4
*
* LICENSE: http://hail2u.mit-license.org/2009
*/
+
+/*jslint indent: 2, browser: true */
+/*global jQuery, $ */
+
(function ($) {
+ "use strict";
+
$.queryYQL = function (statement, type, envUrl, callback) {
if ($.isFunction(type)) {
callback = type;
@@ -19,22 +23,21 @@
envUrl = undefined;
}
- var scheme = ('https:' == document.location.protocol ? 'https' : 'http');
+ var scheme = (document.location.protocol === "https:" ? "https" : "http"),
+ url = scheme + "://query.yahooapis.com/v1/public/yql?callback=?",
+ data = {
+ format: type,
+ q: statement
+ };
if (envUrl === "all") {
envUrl = scheme + "://datatables.org/alltables.env";
}
- var url = scheme + "://query.yahooapis.com/v1/public/yql?callback=?";
- var data = {
- format: type,
- q: statement
- };
-
if (envUrl) {
data.env = envUrl;
}
return $.get(url, data, callback, "json");
};
-})(jQuery);
+}(jQuery));

0 comments on commit 02d2c40

Please sign in to comment.