blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
5
132
path
stringlengths
3
236
src_encoding
stringclasses
29 values
length_bytes
int64
8
7.94M
score
float64
2.52
5.72
int_score
int64
3
5
detected_licenses
listlengths
0
142
license_type
stringclasses
2 values
text
stringlengths
8
7.94M
download_success
bool
1 class
f26495cb8fc9660f87129909876f679a16db61d3
JavaScript
sajrus33/testBar
/testBar.js
UTF-8
4,847
2.796875
3
[]
no_license
class testBar { constructor(options) { this.parent = options.parent || document.body; this.position = options.position || "top"; this.message = options.message || "default message"; this.call = options.call || (() => { alert("get widgets!") }); this.oldScroll = window.scrollY...
true
4e39ccdae2678667118b060adf359b5acb640d38
JavaScript
erezsob/novocap
/src/components/charts-react-vis/util.js
UTF-8
466
2.515625
3
[]
no_license
// @flow import { AXIS } from './../../constants'; import type { Revenues, RevenueItem, RevenuesReactVis } from '../../common/types'; const parsePoints = (values: RevenueItem) => values.map(v => ({ x: v[AXIS.X], y: v[AXIS.Y] })); export default function formatDataForReactVis( data: Revenues ): RevenuesReac...
true
fc326b713d80f14a599347862e4f51aae7e4e206
JavaScript
sehenry620/js_challenges_starter
/assets/javascript/hangman-lite.js
UTF-8
455
3.546875
4
[]
no_license
(function(){ // document.write("hello from hangman-lite.js"); var word = "Stephanie"; var letter = "t"; let result = word.indexOf(letter); console.log(result); if(result == -1){ console.log("No, that letter does not exist"); }else { let answer = (word.split(letter)....
true
a8997a671808083bb6ceddff607e09e2ffc66864
JavaScript
srisaikiranreddy/ik-frontend-practice
/public/scripts/memoize-async.js
UTF-8
950
3.390625
3
[]
no_license
function memo(originalFunction) { const cache = {}; return async (...args) => { const key = JSON.stringify(args); if (cache[key]) { console.log("Cache hit"); return cache[key]; } const result = await originalFunction(...args); cache[key] = result; return result; } } const getD...
true
ec847b8961ef8eee9b994bcc614705b73f4f264d
JavaScript
KowalewskiPawel/React-Redux-Form-Example
/src/App.js
UTF-8
1,166
2.515625
3
[]
no_license
import { useState } from "react"; import DishForm from "./components/DishForm"; import "./styles/app.css"; function App() { const [responseFromApi, setResponseFromApi] = useState( "Response from the API will be visible here" ); const dataSender = async (data) => { const response = await fetch(process.en...
true
09186fcd20bae87604412f9f56d41303dacbd3ec
JavaScript
stefanhranek/problem-solving
/code-wars/credit-card-mask.js
UTF-8
299
3.03125
3
[]
no_license
function maskify(cc) { var maskedString = ""; for (var i = 0; i < cc.length - 4; i++) { maskedString += "#"; } for (var j = 4; j >= 1; j--) { var lastCharacter = cc.charAt(cc.length - j); var lastNums = lastCharacter; maskedString += lastNums; } return maskedString; }
true
eeb8e27a19ff39b90f7bae4f9ee14ff49172ca27
JavaScript
jlcorbett/ses-email-client
/lambdas/get-eml-contents-public.js
UTF-8
2,161
2.5625
3
[ "MIT" ]
permissive
const simpleParser = require('mailparser').simpleParser; const axios = require('axios'); var URL = require('url').URL; const DELIM ='/'; let processEml = async (emlBody) => { return simpleParser(emlBody) .then( d => d); }; const RESPONSE = { statusCode: 400, headers: { "Access-Control-Allow-...
true
b6e01ed5fe0813440c86e9e554ba29c9ebd8534d
JavaScript
AlecSynnestvedt/jsFundamentals
/4-loops/01-forLoops.js
UTF-8
1,508
4.71875
5
[]
no_license
/* - Loops offer us a quick and easy way to do something repeatedly - There are many different kinds of loops, but they all essentially do the same thing: repeat until a specified condition evaluates to false (first 3 are the most prevalent - ES6 came out in 2017 and introduced a lot of new array methods) - fo...
true
b3cc23fc472ccc7e7b2c70952e5eed6ebc462e9d
JavaScript
ShiplakeCS/ShipShape
/static/robot_functions.js
UTF-8
6,082
2.765625
3
[]
no_license
var ongoingTouches = []; var mostRecentDirection = ""; var recentDirections = []; function updateDistanceDisplay(){ var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("distance_display").innerHTML = x...
true
a8ce1d025daa073ca6b7afba154a76be98f40812
JavaScript
wolframkriesing/react-testing-talk
/test/calculator-spec.js
UTF-8
2,694
2.796875
3
[]
no_license
import React from 'react'; import ReactDOM from 'react-dom'; import TestUtils from 'react-addons-test-utils'; import assert from 'assert'; import './setup-jsdom'; describe('calculator example', function() { class Calculator extends React.Component { constructor() { super(); this.state = {screen: 0}...
true
73c0d656ee51307758ba63afbd67c16428962736
JavaScript
D4xor/impostor
/cliente/src/cargarPaginas.js
UTF-8
8,755
2.65625
3
[]
no_license
var div; var row; var col; var divElement; var h1; var h3; var input; var button; var span; var form; function alerta(data,typAlert){ var alerta = `<div class="alert ${typAlert} alert-dismissible fade show" role="alert">`; alerta += '<strong>'+data+'</strong>'; alerta += '<button type="button" class="btn-close" da...
true
69293499f4e34a5593f55f7381b8bfacebad370b
JavaScript
JCDMeira/js-ts-completo
/secao10-NodeNpmExpressMongoDB/aula128-lendo-escrevendoArquivos/modules/write.js
UTF-8
849
3.140625
3
[]
no_license
const fs = require('fs').promises; // const path = require('path'); // const caminhoArquivo = path.resolve(__dirname, '..', 'teste.txt'); // const caminhoArquivo = path.resolve(__dirname, '..', 'teste.json'); // const pessoas = [ // {nome: 'joão'}, // {nome: 'Maria'}, // {nome: 'Eduardo'}, // {nome: 'L...
true
53b027b48dab9d32ebafdaa824d64064ba3a06a7
JavaScript
wagnermarques/SIN5009WithBonitasoft
/tomcat/server/webapps/bonita/portal/scripts/jquery/jqueryplus/extend.js
UTF-8
385
3.671875
4
[ "Zlib", "LZMA-exception", "CPL-1.0", "bzip2-1.0.6", "Apache-2.0", "EPL-1.0", "LicenseRef-scancode-unknown-license-reference", "CDDL-1.0", "GPL-2.0-only" ]
permissive
// Extend String String.prototype.startsWith = function(needle){ return this.toString().indexOf(needle) === 0; } String.prototype.endsWith = function(needle){ return this.toString().substr(this.toString().length - needle.length) === needle; } String.prototype.contains = function(needl...
true
44e8a65b9218b6b4fdf6c779cc4740e7df121082
JavaScript
tangivan/lighthouse-js-fundamentals
/js-exercises.js
UTF-8
2,395
4.09375
4
[]
no_license
//Voting Station Calculation const chooseStations = function(stations) { let goodStations = []; for(let station of stations){ if(station[1] >= 20 && (station[2] === 'school' || station[2] === 'community centre')) goodStations.push(station[0]); } return goodStations; } const stations = [ ['Big Bear ...
true
653e69db1d88a4ae1fee5fc70af956c85b565b1b
JavaScript
dkeza/codefights
/arcade/buildPalindrome.js
UTF-8
1,721
3.96875
4
[]
no_license
function buildPalindrome(str) { var canConvert; for (var i = str.length;; i++) { canConvert = true; for (var j = 0; j < i - j - 1; j++) { if (i - j - 1 < str.length && str[j] != str[i - j - 1]) { canConvert = false; break; } } if (canConvert) { ...
true
aa9d4d8c6874d058c9948d55830b163528bbadaf
JavaScript
robertz/node-billz
/public/js/payee-vue.js
UTF-8
763
2.578125
3
[ "MIT" ]
permissive
const app = new Vue({ el: "#app", data() { return { stats: { total: 0, active: 0, amount: 0 }, payees: [] } }, created() { this.payees = window.kdfe.payees; this.stats.total = this.payees....
true
ae2dc1246244c2743750fb6efcc964b2775d1f9c
JavaScript
alinossier/plotter-vision
/stl.js
UTF-8
8,503
3.046875
3
[]
no_license
/* * Parse binary STL files into a list of triangles. * * Supports projecting them with a camera * and doing hidden-line removal. */ const stl_key2d_scale = 16; function stl_key3d(p) { return int(p.x*100) + "," + int(p.y*100) + "," +int(p.z*100); } function stl_key2d(p) { return int(p.x/stl_key2d_scale) + "," ...
true
954bbde56bba148fc33082518853bff291041060
JavaScript
Taylor-Williams/help-y
/app/assets/javascripts/post.js
UTF-8
1,029
2.765625
3
[ "MIT" ]
permissive
class Post{} Post.getPostRequest = function(){ $.ajax({ dataType: "JSON", url: `/posts/${this.dataset.id}`, method: "get" }).success(Post.renderAllComments) .fail(() => {console.log("there was some error that happened.")}) } Post.renderAllComments = function(post){ $postCommentsDiv = $(`#${post.id}-...
true
35fc403c45a81c45704d0ec4df388075bd8fa89a
JavaScript
floriandw/WNM-_-Api
/middleware/jwt.middleware.js
UTF-8
1,070
2.671875
3
[]
no_license
const jwt = require('jsonwebtoken'); const config = require('../config/jwt.config'); exports.generateJWToken = () => { const expiresIn = 24 * 60 * 60 * 1000; // 1 day in ms const tomorrow = new Date(Date.now() + expiresIn); return jwt.sign( {"tomorrow": tomorrow}, config.secret, ...
true
70ce99a334502b745bfc005794619f34e823f05f
JavaScript
sedc-codecademy/sedc6-ajs
/Group IV/08 - Node and npm/server-one.js
UTF-8
362
2.8125
3
[]
no_license
const http = require('http'); const port = 3000; const server = http.createServer((req, res) => { res.statusCode = 200; res.setHeader('Content-Type', 'text/html'); res.write("<head><body><h1>"); res.write("Hello World"); res.write("</h1></body></head>"); res.end(); }); server.listen(port, () => { con...
true
e54a4e5671410c2e899e794fc2667c5760f6d341
JavaScript
tawhid885/Learn---React
/src/App.js
UTF-8
2,869
2.78125
3
[]
no_license
import React ,{Component} from 'react' import './App.css'; import Person from './components/person' import Book from './components/Book' // function App() { // return ( // <div className = "App" > // <h1>this is first page</h1> // <Person/> // </div> // // React.cre...
true
c5bdc3b3c23ab22734147f6bced128829b675ff4
JavaScript
ammogcoder/PHP-Succinctly
/chapter_6/js/contactform.js
UTF-8
1,203
2.875
3
[]
no_license
function savecontact() { if ( document.getElementById('name').value == "" || document.getElementById('email').value == "" || document.getElementById('subject').value == "" || document.getElementById('message').value == "" || document.getElementById('phonenumber').value == "") { alert("You must ...
true
4d2ac5fd07d7940a8ba62c5029734ec7191493cf
JavaScript
circuit/circuit-sdk
/test/node/helper.js
UTF-8
1,969
2.921875
3
[ "Apache-2.0" ]
permissive
'use strict'; (function (root, factory) { if (typeof module === 'object' && module.exports) { module.exports = factory(); } else { root.helper = factory(); } }(typeof self !== 'undefined' ? self : this, function () { function remove(array, element) { const index = array.indexOf(element); array.splice(ind...
true
07c40d9fd9eec570317d32ba5574b7f8267fc258
JavaScript
simplybychris/IO-Invoices
/IO-Invoices/controllers/seller.controller.js
UTF-8
2,244
2.59375
3
[]
no_license
const Seller = require("../models/seller.model.js"); exports.findAll = (req, res) => { Seller.getAll((err, data) => { if (err) res.status(500).send({ message: err.message || "Some error occurred while retrieving sellers." }); else res.send(data); }); }; exports.findOne = (req...
true
d2d8e77f8d41edaf05daaa4a64868d861727fe31
JavaScript
haris386/TodoAppV4-React
/src/Components/TodoBody/TodosBody.js
UTF-8
3,055
2.65625
3
[]
no_license
import React from 'react' import { useState } from "react"; export default function TodoBody() { const [todos, setTodos] = useState(''); const [newTodo, setNewTodo] = useState([]); const todoEvent = (event) => { setTodos(event.target.value) } const get_update = () => { ...
true
d2e3cac7c184e7c22b7d2af42416c96c6e11afd5
JavaScript
kazuki-yoshioka/flask_template
/WebServer/static/js/SendRequest.js
UTF-8
2,352
2.875
3
[]
no_license
/** * POSTデータ送信 */ function sendJsonData() { //連想配列 var json_asocc = [ { maker: "MAZDA", model: "DEMIO", grade: "XD L pakage", }, ]; url = "http://localhost:5000/fetch"; //JSONにエンコード var JSONdata = JSON.stringify(json_asocc); $.ajax({ type: "post", url: url, data: ...
true
409e178f5355c63be8f339125771e56f4a879d81
JavaScript
pedroovil/spinner
/js/popup.js
UTF-8
2,304
2.8125
3
[]
no_license
POPUP = function (x, y, bg, txt = "", style = {}, del = false, split = "\n") { y -= 100; this.sprite = JOGO.game.add.sprite(x, y, bg); this.sprite.anchor.set(0.5); this.sprite.inputEnabled = true; //this.sprite.input.enableDrag(); this.sprite.fixedToCamera = true; this.sprite.alfa = 0.5; this.txt = txt.split(s...
true
4aa0b8c9e944940ceecf1825f623b24ca54971d6
JavaScript
mkoteswararao08/lab-programs
/nodejs/array-programs/medium/copyArray/test_copy.js
UTF-8
155
2.59375
3
[]
no_license
var alterEle = require("./copyArray.js"); var arr1=[2,3,4,5,6,7]; var arr2=[9,10,11,12,13,14,15]; var altele = alterEle(arr1,arr2); console.log(altele);
true
59d8c2933a123eb39146c4645b760c4a20e42b55
JavaScript
evikaseptianawati/timer
/main.js
UTF-8
1,172
2.90625
3
[]
no_license
feather.replace(); const app = new Vue({ el: '#app', data: { timer: null, totalTime: (25 * 60), resetButton: false, title: "Countdown to rest time!", edit: false, userTime: 25, }, methods: { startTimer: function() { this.timer = setInterval(() => this.countdown(), 1000); //100...
true
c5e88154283a97e40bf2f4bbd0b780d862b352ac
JavaScript
qq529952515/github_spider
/samples/javascript/webshell-gh-pages/src/help.js
UTF-8
7,828
2.765625
3
[]
no_license
/** * httpl://help * Page host providing online help */ var util = require('./util.js'); // require using browserify var server = servware(); module.exports = server; server.route('/', function(link, method) { method('GET', function (req, res) { req.assert({ accept: 'text/html' }); return [200, [ '<html>',...
true
c71ca82eeb096250a5717661dfaf3c25c89b9b52
JavaScript
SourangshuRoy1/Node_trials
/mongoose/models/user_model.js
UTF-8
698
2.578125
3
[]
no_license
// user_model.js //require mongoose.js node module var mongoose = require('mongoose'); //create a schema for data model var userSchema = new mongoose.Schema({ name: String, username: {type: String, unique: true, required:true}, password: {type: String, required: true}, admin: Boolean, location: String, meta:{ ...
true
bf71630a106d7223fdbe0a72ae255aa7c922d2f4
JavaScript
tct13/grocery
/models/customer.js
UTF-8
1,731
2.796875
3
[]
no_license
var mongoose = require('mongoose') var bcrypt = require('bcrypt') var customerSchema = mongoose.Schema({ name: String, local: { email: { type: String, required: true, }, password: { type: String, required: true, }, }, billingAddr...
true
7f3dc66b84c19a51a245d19d72ec01df8dc5ac81
JavaScript
valentin73/Programming-basics-Oct.-2019
/JS-Advanced/DOM/Lab/04. Visited Websites/solution.js
UTF-8
1,457
3.296875
3
[]
no_license
function solve() { const anchors = Array.from(document.querySelectorAll('a')); const counters = anchors.map(el => Number(el.nextElementSibling.innerText.split(' ')[1])); const container = document.querySelector('#page1 > .middled'); container.addEventListener('click', function(e){ const target = e.target; ...
true
d54c56638e9e66a1bc064ae9037100a137824ba8
JavaScript
nd2k/webpack-project
/src/router/router.js
UTF-8
1,463
2.5625
3
[]
no_license
export default class Router { constructor(routes) { this.routes = routes; this.listen(this.routes); } listen = (routes) => { const app = document.getElementById('_app'); let currentPath = document.location.pathname; let navbarLinks = document.getElementById('_navbar').shadowRoot; let acce...
true
e48112cf6ead46aaa172a10deb7a41c2b98f7b9f
JavaScript
littlebabyy/grunt-protractor
/test.spec.js
UTF-8
1,085
2.5625
3
[]
no_license
describe('Super Calculator : calculation', function() { var firstNumber = element(by.model('first')); var secondNmuber = element(by.model('second')); var goButton = element(by.id('gobutton')); var result = element(by.binding('latest')); var signOptions = element.all(by.options('value for (key, value...
true
998ef0bcae5b5b7232dc71aebaec675cb0168ce6
JavaScript
MeninoLorenzooo/LunnaBot
/src/commands/Moderacao/prefixo.js
UTF-8
1,547
2.71875
3
[ "MIT" ]
permissive
module.exports = (client, message, args, retry = 0) => { if (retry > 1) return; if (!message.member.hasPermission("ADMINISTRATOR", false, true, true)) { return message.reply("Sem permissão para trocar o prefix").catch(()=>{}); } if (args.length < 1) { return message.reply("Indique ...
true
49378fff57bd0692941aa896f1927bdb44c7be60
JavaScript
llezhava/pay-manager-app-vanilla-web-components
/views/src/chart/bar.js
UTF-8
2,165
3.109375
3
[]
no_license
const template = document.createElement('template') template.innerHTML = ` <div id="bar"> <div id="value"></div> <div id="fill"></div> <div id="name"></div> </div> <style> :host { width: 3em; } #bar { font-size: 1em; text-align: center; color: #45617e; margin: 0.1em; display: flex...
true
805d8da826cd2588d2fbdecf95b66e574ffaba65
JavaScript
jnepal/car-race
/js/Obstacle.js
UTF-8
799
3.25
3
[]
no_license
function Obstacle(x, y){ this.width = 54; this.height = 16; this.position = 'absolute'; this.element; this.lane; this.top = y; this.left = x; this.image = document.createElement('img'); this.image.src = 'img/obstacle.png'; this.create = function (){ this.element = document.createElement('div'); th...
true
db01d843dd6c6c4928301f18b904c374c776cd93
JavaScript
DmitryKmita/rss-parse-ui
/src/service/ApiService.js
UTF-8
520
2.640625
3
[]
no_license
import * as http from 'http'; class ApiService { hostUrl:String = 'http://localhost:4000/getImages'; getItems(callback) { http.get(this.hostUrl, (resp) => { let data = ''; resp.on('data', (chunk) => { data += chunk; }); resp.on('end', (...
true
70bc00c012c39e4b13902c9c99df0d8083deaf8e
JavaScript
rmichaluszek/tesseract-editor
/js/main.js
UTF-8
2,213
3.140625
3
[]
no_license
//global variables var modelPoints = []; var modelPointsIn3D = []; var pointsConnections = []; var currentPointSelected = 0; function vec4(x,y,z,w) { this.x = x; this.y = y; this.z = z; this.w = w; this.getCoordinates = function() { return {x:this.x,y:this.y,z:this.z,w:this.w}; } } ...
true
fe70a8b042d36a752148adf29e4ae888b7ca16bd
JavaScript
Atzkdeff/news_hometask
/src/js/error-handler-popup.js
UTF-8
1,420
2.546875
3
[]
no_license
import "../styles/popup.scss"; const ErrorHandlerPopup = (function() { let instance = Singleton.instance; function Singleton() { if (instance) return instance; instance = this; } Singleton.prototype.showPopup = function (message) { let popup = document.createElement...
true
2226ef99988ef46e6041f3171de6a3bdc18b72fa
JavaScript
achyuthreddyi/javascript_basics
/chapter5/flattening.js
UTF-8
253
3
3
[]
no_license
a =[[1,2,3],[4,5,6],[7,8,9]] b = new Array() // reducer = (accumulator,current) => accumulator + (current) // b = a.reduce(reducer) // console.log(b) reducer = (accumulator,current) => accumulator.sum(current) b = a.reduce(reducer) console.log(b)
true
8e3fc6cbe1e932648687ec4199fd7b2aac644bec
JavaScript
whitbrooks/FriendFinder
/app/routing/apiRoutes.js
UTF-8
1,961
2.984375
3
[]
no_license
// =============================================================================== // DEPENDENCIES // =============================================================================== var path = require("path"); var friendsArray = require("../data/friends"); // ==========================================================...
true
6ad411957fbb3d3e40a6a2d7b36826e6dcf29178
JavaScript
pdmonge/abo-project
/app/public/js/inst.js
UTF-8
3,052
2.71875
3
[]
no_license
function createInstObj () { let dataObj = {}; if ($("#inst-name").val()) { dataObj.name = $("#inst-name").val().trim(); } else { dataObj.name = $("#current-inst-name").text(); }; if ($("#inst-address").val()) { dataObj.street_address = $("#inst-address").val().trim(); ...
true
a49c3abffbd1e53638663d6e7f330845daa64f22
JavaScript
prurph/Project-Euler
/JS/problem9.js
UTF-8
296
3.609375
4
[]
no_license
var a = 1, b, squaredSum, c = 0; (function() { for (; a < 500; a++) { b = a + 1; for (; a + b + c <= 1000; b++) { squaredSum = Math.pow(a,2) + Math.pow(b,2); c = Math.sqrt(squaredSum); if (a + b + c === 1000) { console.log(a*b*c); } } } })();
true
36d077880a515fc8aac0dcb2f0c9cd0e69e4364f
JavaScript
buzykina/FeelThisThrill
/Website/js/index_js.js
UTF-8
1,920
2.703125
3
[ "MIT" ]
permissive
var clock; $(document).ready(function() { // Grab the current date var currentDate = new Date(); // Set some date in the past. In this case, it's always been since Jan 1 var pastDate = new Date("August 20, 2018 20:00:00"); // Calculate the difference in seconds between the future and current date var diff =...
true
ebf08efeee319fdc4e066bc626d97dcc8869bdfa
JavaScript
raooll/agent
/scripts/services/UtilService.js
UTF-8
13,965
2.6875
3
[]
no_license
(function (angular){ "use strict;" angular.module('bargain').factory('UtilService', ['$rootScope', 'IntimationService', function ($rootScope, IntimationService) { var ua = navigator.userAgent.toLowerCase(); var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; if (ua.indexOf(" chrom...
true
5091f1df498c29ea2153fcfe796a066d2212ce25
JavaScript
alilthumuch/data-structures
/sprint-one/src/es6/stack.js
UTF-8
616
3.609375
4
[]
no_license
class Stack { // Hey! Rewrite in the new style. Your code will wind up looking very similar, // but try not not reference your old code in writing the new style. constructor() { this.storage = {}; }; push(value) { var index = Object.keys(this.storage).length; this.storage[index] = value; }; pop()...
true
07c16423fe9288efae3c2d7d17fee634f27dad45
JavaScript
dstiers-1109/dig-react
/app/components/vanilla/Alert.js
UTF-8
1,731
2.625
3
[]
no_license
/*eslint "react/no-danger":0 */ /* globals $ */ import React from 'react'; const ALERT_TIMEOUT = 5000; var Alert = React.createClass({ getInitialState: function() { return { type: this.props.type, id: this.props.id || 'sys-alert', cls: 'alert fade in alert-' + this.props.type + '...
true
4eb1f5b5cfd6ecb07fc93f4757abc150a63193c6
JavaScript
hoodcat6506/phaser-example
/src/service_worker.js
UTF-8
1,447
2.671875
3
[]
no_license
const CACHE_NAME = 'my-site-cache-v1'; const urlsToCache = [ '/phaser-example/', '/phaser-example/dist/main.js', '/phaser-example/assets/images/particles/blue.png', '/phaser-example/assets/images/skies/space3.png', '/phaser-example/assets/images/sprites/phaser3-logo.png', ]; self.addEventListener('install', ...
true
459258d8f6f267e9adcca1dec47d81784e3aabb1
JavaScript
TraeBenn22/data-structures-and-algorithms
/linked_list/linked-list.js
UTF-8
3,507
3.53125
4
[]
no_license
'use strict'; class Node { constructor() { this.value = null; this.next = null; } } class LinkedList { constructor() { this.head = null; } recursiveAppend(value) { if (this.head === null) { this.head = value; } else { this.recursiveA...
true
ae5d79abf3424c69536a7042fca47090771f40f7
JavaScript
TinkeringAround/Lambda-Collection
/Online-Remote-Update/Publish/index.js
UTF-8
2,303
2.796875
3
[]
no_license
'use strict' // required modules var aws = require('aws-sdk'); // Lambda Instance var lambda = new aws.Lambda({ region: 'eu-central-1' }); // s3 bucket instance var s3 = new aws.S3({ apiVersion: '2006-03-01', region: 'eu-central-1' }); // main Lambda Function handler exports.handler = function (event, context...
true
d7273aee8c6103e5c258d091711f3c029bfd8b69
JavaScript
Rahul-Panchal/react-food-app
/src/store/actions/myaction.js
UTF-8
1,802
2.65625
3
[]
no_license
export const changeFirstName = (name)=>{ return{ type : 'CHANGE_NAME', payload : name } } export const changeLastName = (name)=>{ return{ type : 'CHANGE_LAST_NAME', payload : name } } export const saveTokenValue = (token)=>{ return{ type : 'SAVE_TOK...
true
b3b66204a85eeb2fbc27cd53805e43bd8c50953f
JavaScript
brianbaso/Social-Blog-App
/routes/index.js
UTF-8
2,203
2.84375
3
[]
no_license
/* We will use the express router to refactor our routes. We will then add all of the routes to router, instead of app. Think of the router like an object with methods on it but instead the router is an object with all of the routes attached to it. At the bottom of the file we will have to export router so that we ...
true
07aaf2ad4994218b41dbb3aa5cb46e6846776304
JavaScript
Apriorhythm/apriori_web_tools
/apriori_review/static/apriori_review/js/index.js
UTF-8
1,240
2.828125
3
[]
no_license
function getContent() { $.get('/review/content' ,function(data){ $.each(data, function(index, review) { singleContent = '' + '<li class="list-group-item">' + '<div>' + review.content + '</div>' + '</li>'; $("#review-content-ul").append(singleConte...
true
91bba6726c39c6205c218def973372cfd247c0fe
JavaScript
Oussama250/Linear_and_datastructure
/javascript_functions.js
UTF-8
1,111
3.90625
4
[]
no_license
// javascript function : sum of overlapping elements. const sum = (arr1, arr2) => { let Sum=0; let arr3=[]; for(let a = 0; a < arr1.length; a++) { for(let b = 0; b < arr2.length; b++){ if(arr1[a]==arr2[b]) arr3.push(arr1[a]); } } for(let a = 0; a < arr2.length; a++){ ...
true
fd6dc594eccf9843c91daaf25ea13ac423ee2c0c
JavaScript
duanwandao/algs
/nine-chapters/chapter 2/related/141. 69. Sqrt(x).js
UTF-8
633
3.75
4
[]
no_license
// Implement int sqrt(int x). // // Compute and return the square root of x, where x is guaranteed to be a non-negative integer. // // Since the return type is an integer, the decimal digits are truncated and only the integer part of the result is returned. var mySqrt = function(x) { let start = 1; let end = x;...
true
004196f8a31f41ecbfc33d7571983467b8d7d696
JavaScript
gkjohnson/threejs-sandbox
/conditional-lines/src/OutsideEdgesGeometry.js
UTF-8
1,268
2.625
3
[ "MIT" ]
permissive
import { BufferGeometry, Vector3, BufferAttribute } from '//cdn.skypack.dev/three@0.130.1/build/three.module.js'; const vec = new Vector3(); export class OutsideEdgesGeometry extends BufferGeometry { constructor( geometry ) { super(); const edgeInfo = {}; const index = geometry.index; const position = geom...
true
6ae895ba0522866d2ec74673b6d5987ffc21f4d5
JavaScript
danidark9312/GJCCloud
/src/main/webapp/js/graficos/graficoCasosPorTipoCaso.js
UTF-8
2,528
2.578125
3
[ "MIT" ]
permissive
var graficoCasosPorTipoCaso = new graficoCasosPorTipoCaso(); function graficoCasosPorTipoCaso() { /** * INICIO METODOS Y VARIABLES PUBLICOS * */ var mostrarGrafico = function() { $.ajax({ type : "POST", url : contexto + "/home/consultarCasosPorTipoCaso", data : "_csrf=" + $("#_csrf").val(), ...
true
cea29339d6c35f6d46f4f8d81800320b4eac177c
JavaScript
victorrss/crawler-sondame
/crawler.js
UTF-8
2,331
2.609375
3
[]
no_license
const fs = require('fs'); const request = require('request'); const cheerio = require('cheerio'); const urlFile = 'http://www.sonda.me/file/'; var files = []; var begin = 90550; var end = begin+500; for (let i = begin; i <= end; i++) { request(urlFile + i, function (error, response, html) { console.log('A...
true
d0e2d5d6c732443a4226a07382ff28b148f8453d
JavaScript
emgyrz/ar-templater
/bin.js
UTF-8
1,837
2.703125
3
[]
no_license
#! /usr/bin/env node const templater = require( './index.js' ) const argv = process.argv const avaliableCommands = { help: argv.includes( 'help' ), start: argv.includes( 'start' ), build: argv.includes( 'build' ) } const commands = Object.keys( avaliableCommands ).filter( key => avaliableCommands[ key ] ) ...
true
de55e31ec369c8afe32c4bd027c8a614ae87d4d8
JavaScript
kaisa911/LeetCode
/Solutions/Easy/703-KthLargestElementinaStream.js
UTF-8
2,845
3.859375
4
[]
no_license
/** * @param {number} k * @param {number[]} nums */ var KthLargest = function(k, nums) { //排序后,小顶堆; 先变成堆形态 this.heap = new Heap(); this.k = k; for (var i = 0; i < nums.length; i++) { if (this.heap.length < k) { this.heap.push(nums[i]); } else if (this.heap.peek() < nums[i]) { this.heap.p...
true
4c2e9b5ce8d654c4e0c0499810a7e530f4d2892e
JavaScript
Sarumathikitty/guvi
/javascript/codekata/strings/given_two_strings_are_complementary_or_not.js
UTF-8
391
3.109375
3
[]
no_license
const readline = require ('readline'); const inp=readline.createInterface({ input:process.stdin }); const m=[]; inp.on("line",(data)=>{ m.push(data); }); inp.on("close",()=>{ var S1=m[0]; var S2=m[1]; var a="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; var b=S1+S2; if(a==b.split("").sort().join("")){ co...
true
f4205a7f38b1dfbc346cb19188894bb6382f18cc
JavaScript
geekyorion/freecodecamp
/JavaScript Algorithms and Data Structures/Object Oriented Programming/014-Understand-Where-an-Object’s-Prototype-Comes-From.js
UTF-8
329
3.40625
3
[]
no_license
function Dog(name) { this.name = name; } let beagle = new Dog("Snoopy"); // Only change code below this line console.log(Dog.prototype.isPrototypeOf(beagle)); // link: https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/object-oriented-programming/understand-where-an-objects-prototype-co...
true
78d6b6a5e6e947a39accac64726a5b12b06d795f
JavaScript
huozhi/leetcode.js
/src/minimum-time-difference.js
UTF-8
640
3.234375
3
[]
no_license
/** * @param {string[]} timePoints * @return {number} */ var findMinDifference = function(timePoints) { const times = timePoints.map(time => { const [min, sec] = time.split(':').map(n => parseInt(n, 10)) return min * 60 + sec }) const maxSec = 24 * 60 let minDis = maxSec for (let ...
true
06aa1c046f6f736b773f4c012f02e8ea60bd7d2d
JavaScript
Rainsho/react_step_by_step
/lesson107/src/components/DoerInfo.jsx
UTF-8
1,781
2.53125
3
[]
no_license
import React from 'react'; import store from '../stores/TodoStore'; import action from '../actions/TodoAction'; import { DOER_CHANGE } from '../constants/TodoEvents'; export default class DoerInfo extends React.Component { constructor(props) { super(props); this.state = { doer: store.getDoer(), e...
true
6606ba6cb8d0c25de3c0ade9702344ca0f3df3a5
JavaScript
tojibon/CasperJS
/PicJumbo.js
UTF-8
1,214
2.9375
3
[]
no_license
/* A scrapping script to download picjumbo photos. 1. https://picjumbo.com - Base Domain 2. https://picjumbo.com/category/abstract/ - Category URL 3. https://picjumbo.com/category/abstract/page/2/ - Pagination URL */ var category = 'abstract'; var links = []; var curPageImgSrcList = []; var casper = require("casper")...
true
3cd1abb878c84ac47abe7251fbf1fa007df87bf5
JavaScript
neobats/react-todo-material
/src/App.jsx
UTF-8
2,673
2.75
3
[]
no_license
import React, { Component } from 'react' import { List } from './List' import Input from './Input' import { Title } from './Title' import { Footer } from './Footer' import * as VF from './visibilityFilter' export default class App extends Component { state = { todos: [ { text: 'Ship ap...
true
31cbdcf1c1ada647c7c27021f024b5a25205dfb6
JavaScript
Felx-B/bootstrap-css-variable
/js/tests/unit/dom/selectorEngine.js
UTF-8
2,934
2.59375
3
[ "MIT", "CC-BY-3.0" ]
permissive
$(function () { 'use strict' QUnit.module('selectorEngine') QUnit.test('should be defined', function (assert) { assert.expect(1) assert.ok(SelectorEngine, 'Manipulator is defined') }) QUnit.test('should determine if an element match the selector', function (assert) { assert.expect(2) $('<in...
true
ac93bd46342590ca85ba0ef56396d562a9bc51a6
JavaScript
meta-meta/react-synonym-game
/src/App.js
UTF-8
4,696
2.59375
3
[ "MIT" ]
permissive
import React, { Component } from 'react'; import axios from 'axios'; import Synonym from './Synonym'; const transitionMillis = 2000; export default class App extends Component { constructor() { super(); this.state = { apiKey: '', targetWord: '', exampleSentence: 'this is an example sente...
true
ad68c8f56b3fd76f4ba2a53a14e8ddfa3886abb9
JavaScript
PaulKinlan/ChromeWebLab
/Sketchbots/sw/ui/controller/libs/weblab/utils/canvas/colour/PixelOps.js
UTF-8
7,588
2.65625
3
[ "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause", "CC0-1.0", "MIT", "LicenseRef-scancode-public-domain", "BSD-2-Clause", "Bitstream-Vera", "Apache-2.0" ]
permissive
(function(){ var namespace = WEBLAB.namespace('WEBLAB.utils.canvas.colour'); if (namespace.PixelOps === undefined) { namespace.PixelOps = function () { this.me = this; }; var p = namespace.PixelOps.prototype; p.useCanvas = function(canvas) { this.canvas = canvas;...
true
65fce08029a6af86ebd8af8c9b965070c34bfbec
JavaScript
weynelucas/organizze-api
/app/Controllers/BaseController.js
UTF-8
6,082
2.734375
3
[ "MIT" ]
permissive
const express = require('express'); const autobind = require('auto-bind'); const mongoose = require('mongoose'); const { filterKeys } = require('../Utils/Object'); const { NotFoundError } = require('../Utils/Http'); class BaseController { /** * @param {mongoose.Model|string} model The default model object for t...
true
2b47a8512b8804de1e8e4062259212328226ed60
JavaScript
js-tasks-ru/jsbasic-20210325_itsmeevg
/1-module/5-task/index.js
UTF-8
163
3.109375
3
[]
no_license
function truncate(str, maxlength) { if (typeof str === 'string' && str.length > maxlength) { str = str.slice(0, maxlength - 1) + '…'; } return str; }
true
5ffeef54062630e590da95a0c2b44e9b5824bd05
JavaScript
hanjika/event-countdown
/src/js/display.js
UTF-8
2,361
3.125
3
[]
no_license
import { PERIODS } from './periods'; import { createLiButton } from './create'; let periodsRequired; export function displayEvent(timestamp, listItem, event) { fromNow(timestamp, listItem); listItem.innerText += ' until ' + event; } function fromNow(timestamp, listItem) { const resultArr = [];...
true
97e83ee1d7628751dc12ba390f0bd9f37e116b7c
JavaScript
dldev3/vanilla-node-rest-api
/models/bookModel.js
UTF-8
1,135
2.734375
3
[]
no_license
let books = require('../data/books'); const { v4: uuidv4 } = require('uuid'); const { writeDataToFile }= require('../utils'); function findAll(){ return new Promise((resolve,reject)=>{ resolve(books) }); } function findById(id){ return new Promise((resolve,reject)=>{ const book = books.find(...
true
ebe18bc2611e09f80790f9d3493ba60907d09b5a
JavaScript
silvio-souza/codewars-challenges
/code-wars/sumOfDigits.js
UTF-8
324
3.390625
3
[]
no_license
// https://www.codewars.com/kata/541c8630095125aba6000c00/train/javascript function digital_root(n) { let sum = 0; for (i = String(n).length - 1; i >= 0; i--) { sum += Number(String(n)[i]); } if (String(sum).length > 1) { return digital_root(sum); } return sum; } console.log(digital_root(493193...
true
288c6d69fe3d6b93f8067080f0f4bf298f165fb8
JavaScript
oaspireo/imageDownloader
/my_app.js
UTF-8
958
2.578125
3
[]
no_license
var http = require('http'), fs = require('fs'), jsdom = require("jsdom"), fileType = "", options = { host: '', //the website path: false }; console.log("Loading images:"); jsdom.env("", [// the page 'http://code.jquery.com/jquery-1.5.min.js' ], function(errors, window) { win...
true
47cb7e5afffa41b03469fe86f7260eae4ef4398b
JavaScript
onefork/md2xliff
/test/extract.js
UTF-8
29,155
2.75
3
[]
no_license
const assert = require('assert'); const extract = require('../lib/extract'); function assertContent(actual, expected) { actual.units.forEach((unit, idx) => assert.equal( unit.source.content, typeof expected === 'string' ? expected : expected[idx]) ); } describe('extract', function() { it('...
true
5453cabca3fb4b5338c5ccd450ce7197af4f8611
JavaScript
vaibhav2110/V-coin
/blockchain/index.test.js
UTF-8
1,459
2.796875
3
[]
no_license
const BlockChain = require('./index'); const Block = require('./block'); describe('Blockchain', ()=>{ let bc, bc2; beforeEach(()=>{ bc = new BlockChain(); bc2 = new BlockChain(); }); it('first Block is genesis block', ()=>{ expect(bc.chain[0]).toEqual(Block.genesis());...
true
b7b2f11588eae8fea29873e1981c0d680a642b1f
JavaScript
klaas1ck/Kindling
/models/loginSchema.js
UTF-8
990
2.640625
3
[]
no_license
const mongoose = require('mongoose'); const Schema = mongoose.Schema; // const bcrypt = require('bcrypt'); const loginSchema = new Schema({ username: { type: String, required: true, unique: true }, password: { type: String, required: true }, email: { type...
true
53893ef179417beaed687a628c875b7db6d58340
JavaScript
WandCorp/quickConsole
/src/suggestion.js
UTF-8
1,202
2.671875
3
[ "Apache-2.0" ]
permissive
var QC; (function(QC) { "use strict"; function Suggestion(fullCommand) { this.fullCommand = fullCommand; this.commandsToComplete = this.getLastCommand(); } Suggestion.prototype.getLastCommand = function () { if (!this.fullCommand || this.fullCommand === "") { ...
true
dfe714309d45610bc0e572194bada5f64bd4694c
JavaScript
athornton95/users-and-cats
/controllers/catsController.js
UTF-8
5,951
2.8125
3
[]
no_license
const express = require('express'); const router = express.Router(); const Cat = require('../models/Cat'); const User = require('../models/User'); router.get('/', (req, res)=>{ //find all the cats living in the database, called catsFromTheDatabase Cat.find({}, (err, catsFromTheDatabase)=>{ //render a page ...
true
35f7d446206b0541bbb0a453e8d386eecad288d8
JavaScript
j-luis996/fundamentosNodeJS
/src/modulos/process.js
UTF-8
605
2.796875
3
[]
no_license
//esta libreria viene en el objeto global, no es necesario importar nada process.on('beforeExit', () =>{ console.log("el proceso va a acabar") }) process.on('exit', () =>{ console.log("el proceso a cabó") setTimeout(()=>{ console.log('esto no se va a ver') },1000) }) process.on('unca...
true
c7ea373245406e00b1e99309b5245c1557ca8eaa
JavaScript
kariz711/kariz711.github.io
/appliedapi/script.js
UTF-8
283
2.59375
3
[]
no_license
$(document).ready(function() { // var key= "AIzaSyBU15lDu1_9jywYVdMfPrHNl0gOYpkzNBs"; var url = "http://swapi.co/api/people/1/"; $.getJSON(url, function(data){ console.log(data); $(".name").html(data["name"]); }); $(".ls").on("click", function (){ $(".name").toggleClass("clicked"); }); });
true
3d384a10d217d7421c15de26afe43089cb81d013
JavaScript
JatuphumS/TODO-LIST
/src/page/Login/Login.js
UTF-8
3,052
2.59375
3
[]
no_license
import React, { useState, useEffect } from 'react' import { Button } from 'react-bootstrap' import './Login.styles.css' import Input from '../../component/Input/Input' const configLogin = { username: { type: 'text', value: '', label: 'USERNAME', valid: false, validation: {...
true
d12ab5e41e1734b475e954d9c64a8c4241d195be
JavaScript
KovalchukVLad/kursy
/JAVASCRIPT/Javascript5/code.js
UTF-8
15,122
3.3125
3
[]
no_license
// - Створити функцію конструктор для об'єкту який описує теги // Властивості // -назва тегу // - опис його дій // - масив з атрибутами (2-3 атрибути максимум) // Кожен атрибут описати як окремий який буде містити // -назву атрибуту // -опис дії атрибуту // інформацію брати з htmlbook.ru // // Таким чином описати теги...
true
4ac707b8112d32fccd90140192fdf6a662040460
JavaScript
sleopardo/js-training
/es2015/classes/exercises/inheritance/src/walker.js
UTF-8
635
3.25
3
[ "MIT" ]
permissive
// * exports // - default: class // * constructor parameters // - legs: the amount of legs the walker has // * methods // - getLegs : It returns the amount of legs (the ones received in the constructor) // - getSteps: It returns the amount of steps done // - walk : It increments the amount of steps done export defa...
true
9213badff96d66a7664b93071ecb88c3b64e60e7
JavaScript
OREOA/ecologi-k-back
/models/product.js
UTF-8
1,032
2.546875
3
[]
no_license
const mongoose = require('mongoose') const productSchema = new mongoose.Schema({ ean: String, isConsumerGood: Boolean, attributes: { WHERL: { value: { value: String, } }, }, marketingName: { finnish: String, }, }) productSchema.st...
true
c773b85694f7ab327fa183c79392a23fb4fd235b
JavaScript
SA-ODell/movie-crud
/sources/main.js
UTF-8
1,925
3.25
3
[]
no_license
$(document).ready(function() { var movies = []; // Movie data table selector var $movieList = $('.movie-list'); $.get('/movies') .then(getMovieData) .then(createMovieList) .catch(err => { console.log(err); }); function getMovieData(data) { data.forEach(movie => { movies.push(movie); ...
true
c44c6dcf630b38c791c31dbfba97dba0a4318f8e
JavaScript
coderXeno/React-Projects
/jokes.js
UTF-8
968
2.71875
3
[ "MIT" ]
permissive
import React from "react" //Defining a unique id for each individual element pairs const jokes = [ { id: 5, punchLine: "This is a big LOL!!" }, { id: 6, question="Yo! How art thou??", punchline="I ought to get better day by day but my luck doesnt lol" ...
true
dff5cfd9980f0fe537ae34a2a7d7bb53780c341d
JavaScript
brentvatne/react-native-course
/exercises/5-debugging/solutions/3.js
UTF-8
1,446
2.515625
3
[]
no_license
import React from 'react'; import { View, Text, TextInput, StyleSheet } from 'react-native'; const styles = StyleSheet.create({ container: { justifyContent: 'center', alignItems: 'center', padding: 10, }, input: { borderColor: '#ddd', width: 100, borderWidth: 1, }, messageContainer: {...
true
0251036c2dc2516f7ae30791c9eabfa435a22961
JavaScript
shafiqraees/hrm
/assets/js/dashboardjs/custom-dashboard.js
UTF-8
1,591
2.5625
3
[ "MIT" ]
permissive
//Backup and restore page $(document).ready(function(){ var form = $("#brFrm"); var message = $("#message"); //upload process form.on('submit', function(e) { e.preventDefault(); var x = confirm('Are You Sure ?'); if (!x) return false; $.ajax({ url...
true
fcdae24561447fb6257c32ec9af2b4713bd240a4
JavaScript
Teembokeem/WDI_work
/work/w02/d02/rocky_function_summit/rock.js
UTF-8
1,309
3.71875
4
[]
no_license
console.log("worked!"); var arrayToString = function(numbers) { return numbers.join(); }; var esrever = function(reverseMe) { return reverseMe.split("").reverse().join(""); }; var words = ["apple", "Zardoz", "crap"]; var alphabetize = function(words) { return words.sort(function (a, b) { return a.toLowe...
true
c9216ccb8f9fdaa31c64784a10e6e91088144071
JavaScript
truittj/weather_dashboard
/script.js
UTF-8
6,863
2.9375
3
[]
no_license
// var inputCitiesArray = []; var inputCitiesArray = JSON.parse(localStorage.getItem("cityArray")); if (!Array.isArray(inputCitiesArray)) { inputCitiesArray = []; } function sanitizeCityInput(cityInput) { var queryURL = "https://api.openweathermap.org/data/2.5/weather?q=" + cityInput + "&appid=6f878781f6244cc...
true
e81e3d7d0ba4a83f5389729c7677922f125a28bd
JavaScript
SeBa1708/to-do-list-app
/js/script.js
UTF-8
1,434
3.9375
4
[]
no_license
//1. Adding a new item to the list of items: function newItem() { let li = $('<li></li>'); // Declaration of the variable with $('<li></li>') let inputValue = $('#input').val(); // $('#input') is used to target the index element // val() is used to store & return the value of inputValue li.append(inputValue)...
true
93f527fb0918e61bd092113e14f0dcfc6e7473e4
JavaScript
jehuamanna/dctacamdemy-pre-course
/conditionals/positive.js
UTF-8
162
3.421875
3
[]
no_license
function determinePositive(number){ if(number>=0){ return "Positive"; } else return "Negative" } console.log(determinePositive(-23))
true
62a6ca94e752ecfc873d140af16928342409bc54
JavaScript
jschmidt424/web-sprint-challenge-advanced-state-management
/smurfs/src/components/Form.js
UTF-8
1,514
2.59375
3
[]
no_license
import React, { useState, useEffect } from "react"; import { connect } from "react-redux"; import { addSmurf, fetchData } from "../actions/action"; const Form = (props) => { useEffect(() => { props.fetchData(); }, []); const [newSmurf, setNewSmurf] = useState({ name: "", age: "", height: "", }...
true
48c6dee4ecf6685b156ea43c6a9218a5167d7d14
JavaScript
turnerweb/shorturl
/js/main.js
UTF-8
3,171
3.25
3
[]
no_license
//Toggle mobile Navigation document.querySelector('.header__hamburger').addEventListener('click', () => { document.querySelector('.header__mobile').classList.toggle('header__mobile--show'); }) //Check for localstorage let localData = localStorage.getItem('shortLinkData'); if(localData !== null) { buildLink...
true
e02762f8d3308fc41bbf0ebc2220b4859e15e4b6
JavaScript
lluke8/pd_apirest
/front_apirest/script.js
UTF-8
3,413
3.015625
3
[]
no_license
$(document).ready(function(){ getNoticias(); $("#salvarNoticia").click(function() { salvarNoticia(); }); }); function getNoticias() { $.ajax({ url : "http://127.0.0.1:8080/api/noticias", type : 'get', dataType: 'json', }) .done(function(response){ console.log(r...
true
797c5156659e68a462c104590d5269ce52a6ee20
JavaScript
smckinney1/WikipediaViewer
/main.js
UTF-8
1,944
2.96875
3
[]
no_license
//When user hits "enter" or clicks "Search," initiate the API call to Wikipedia using the search terms contained in the text box submission $('#btn-search').click(function() { $.ajax({ type: 'GET', //type GET is default /* url: 'https://en.wikipedia.org/w/api.php?action=query&callback=?',*/ ...
true