How to use the jquery.get function in jquery

To help you get started, we’ve selected a few jquery examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github galaxyproject / galaxy / client / galaxy / scripts / mvc / tool / tools.js View on Github external
this.timer = setTimeout(() => {
                // log the search to analytics if present
                if (typeof ga !== "undefined") {
                    ga("send", "pageview", `${getAppRoot()}?q=${q}`);
                }
                $.get(
                    self.urlRoot,
                    { q: q },
                    data => {
                        self.set("results", data);
                        $("#search-spinner").hide();
                        $("#search-clear-btn").show();
                    },
                    "json"
                );
            }, 400);
        }
github spchuang / fb-local-chat-bot / localChatWeb / js / src / LocalChatStore.js View on Github external
_getPersistentMenu(): void {
    const url = this._baseURL + '/localChat/persistentMenu';
    $.get(url)
      .done((res: Array) => {
        this._persistentMenu = res;
        this.emitChange();
      })
      .fail((res: Object) => {
        console.log(res);
      });
  }
github renhongl / aiting / app / component / articleDashboard / articleDashboard.jsx View on Github external
goToPage(data) {
        let id = this.state.id;
        let url = 'http://www.lrts.me/ajax/playlist/2/' + id + '/' + data.from;
        $.get(url, (result) => {
            let $li = $(result).find('.section-item');
            let total;
            if(!$($(result).find('div')[0]).find('span')[1]){
                total = 10;
            }else {
                total = $($(result).find('div')[0]).find('span')[1].innerText;
            }
            let songs = {
                data: {
                    info: []
                }
            };
            $.each($li, (i, item) => {
                let music = {
                    songname: $(item).find('span')[1].innerText,
                    singername: $(item).find('.column2')[1].innerText,
github polyball / polyball / polyball / client / hudbehaviors / UserListRenderers.js View on Github external
module.exports.PlayerQueueListRenderer = function (config) {

    $.get('hudcomponents/playerQueue.html', function (data) {
        Logger.debug('Injecting player queue.');

        $(config.appendTo).append(data);
    });

    this.render = function (playerQueue, localID) {
        var playerQueueList = $('.playerQueue');
        playerQueueList.empty();
        if (playerQueue.length === 0) {
            playerQueueList.append(
                $('<li>').addClass('grayed').text('No players queued.')
            );
        }
        playerQueue.forEach(appendNameToList(playerQueueList, localID));
    };
};</li>
github LeadingEdgeForum / atlas2 / src-ui / map-list / single-workspace-store.js View on Github external
fetchSingleWorkspaceInfo() {
    this.serverRequest = $.get('/api/workspace/' + this.workspaceID)
      .done(function(result) {
        this.errorCode = null;
        this.workspace = result;
        this.emitChange();
      }.bind(this))
      .fail(function(error) {
        this.errorCode = error.status;
        this.emitChange();
      }.bind(this));
  }
github TriplyDB / YASGUI / src / stories.js View on Github external
return Promise.resolve().then(function() {
        return $.get(url);
      });
    } else {
github LeadingEdgeForum / atlas2 / src-ui / workspace / workspace-list-store.js View on Github external
updateWorkspaces() {
    this.serverRequest = $.get('/api/workspaces', function(result) {
      this.workspaces = result;
      this.emitChange();
    }.bind(this));
  }
github windyGex / SimpleUI / src / auto-complete.js View on Github external
}
            } else {
                //发送请求,改变input状态
                this.node.addClass(this.get('loadingClass'));
                var postData = {}, name = this.node.attr('name');
                postData[name] = value;
                if (source.name && source.name.indexOf('Store') > -1) {
                    source.find(postData, {
                        strict: false
                    }).then(function (result) {
                            this.parse(result);
                        }.bind(this));
                }
                //尝试远程获取数据
                else if (typeof source === 'string') {
                    $.get(source, postData).then(function (result) {
                        this.parse(result);
                    }.bind(this));

                } else if (typeof source === 'function') {
                    source(value, function (result) {
                        this.parse(result);
                    }.bind(this));
                }
            }
        },
        /**
github invinst / CPDB / dashboard / static / dashboard / js / utils / NewSessionAnalyticAPI.js View on Github external
getRecent: function () {
    if (ajax) {
      ajax.abort();
    }

    var end = moment().add(1, 'd').format(AppConstants.DATE_FORMAT);
    var begin = moment().subtract(AppConstants.NUMBER_OF_DAYS_SHOWN_IN_NEW_SESSION_CHART, 'd')
      .format(AppConstants.DATE_FORMAT);

    ajax = jQuery.get(AppConstants.NEW_SESSION_ANALYTICS_API_ENDPOINT, {begin: begin, end: end})
      .done(function (data) {
        data = fill(data, begin, end);
        NewSessionPerDayChartActions.receivedData(data);
      });
  }
};
github promethe42 / cocorico / app / src / script / store / ArgumentStore.jsx View on Github external
_likeHandler: function(argument, value) {
    if (argument.likes && argument.likes.length) {
      var oldValue = argument.likes[0].value;

      jquery.get(
        '/api/argument/like/remove/' + argument.id,
        (data) => {
          argument.likes = [];
          argument.score += data.like.value ? -1 : 1;

          if (value !== oldValue)
            this._addLike(argument, value);

          this.trigger(this);
        }
      ).error((xhr, voteStatus, err) => {
        this.trigger(this);
      });
    } else {
      this._addLike(argument, value);
    }