Skip to main content
tweak
Source Link
DinoCoderSaurus
  • 28.6k
  • 2
  • 12
  • 31

The jQuery doc for getJSON says it takes a url as an argument. (First hit with "jquery getJSON" search using Google).

The flask doc for url_for (first hit from internet search for "flask url_for" and searching the document) offers another link for Quickstart.

The (supplied) search function shows the pieces in action (no google required :)

function search(query, syncResults, asyncResults)
{
    // get places matching query (asynchronously)
    var parameters = {
        q: query
    };
    $.getJSON(Flask.url_for("search"), parameters)
    .done(function(data, textStatus, jqXHR) { 

I hope this helps.

The jQuery doc for getJSON says it takes a url as an argument. (First hit with "jquery getJSON" search using Google).

The flask doc for url_for (first hit from internet search for "flask url_for" and searching the document) offers another link for Quickstart.

The (supplied) search function shows the pieces in action:

function search(query, syncResults, asyncResults)
{
    // get places matching query (asynchronously)
    var parameters = {
        q: query
    };
    $.getJSON(Flask.url_for("search"), parameters)
    .done(function(data, textStatus, jqXHR) { 

I hope this helps.

The jQuery doc for getJSON says it takes a url as an argument. (First hit with "jquery getJSON" search using Google).

The flask doc for url_for (first hit from internet search for "flask url_for" and searching the document) offers another link for Quickstart.

The (supplied) search function shows the pieces in action (no google required :)

function search(query, syncResults, asyncResults)
{
    // get places matching query (asynchronously)
    var parameters = {
        q: query
    };
    $.getJSON(Flask.url_for("search"), parameters)
    .done(function(data, textStatus, jqXHR) { 

I hope this helps.

Source Link
DinoCoderSaurus
  • 28.6k
  • 2
  • 12
  • 31

The jQuery doc for getJSON says it takes a url as an argument. (First hit with "jquery getJSON" search using Google).

The flask doc for url_for (first hit from internet search for "flask url_for" and searching the document) offers another link for Quickstart.

The (supplied) search function shows the pieces in action:

function search(query, syncResults, asyncResults)
{
    // get places matching query (asynchronously)
    var parameters = {
        q: query
    };
    $.getJSON(Flask.url_for("search"), parameters)
    .done(function(data, textStatus, jqXHR) { 

I hope this helps.