Skip to content

Instantly share code, notes, and snippets.

@JannesMeyer
JannesMeyer / Basic API call (TypeScript).EXCEL.yaml
Created November 12, 2020 22:42
Performs a basic Excel API call using TypeScript.
name: Basic API call (TypeScript)
description: Performs a basic Excel API call using TypeScript.
host: EXCEL
api_set: {}
script:
content: |
document.getElementById("run").onclick = () => tryCatch(run);
async function run() {
await Excel.run(async (context) => {
<html>
<head>
<title>Test</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://fb.me/react-0.5.1.js"></script>
<script src="http://fb.me/JSXTransformer-0.5.1.js"></script>
</head>
<body>
/**
* Copyright 2013-2014 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
var apiBaseUrl = 'http://citytagger/frontend_dev.php/api/';
var searchForm = $('#search-form');
searchForm.on('submit', function(e) {
e.preventDefault();
var felder = $(this).serializeArray();
console.log('Felder: ', felder);
$.get(apiBaseUrl + 'search?val=a', function(response) {
if (!response.success) return;
###
Async.js is a collection of simple async patterns
built to combat callback hell
###
###
ASYNC SEQUENCE
Allows a user to define a sequence of async functions.
EXAMPLE:
async = require 'async'