param endpoint param callback param args function jsonp ( endpoint , callback , args ) { const script = window . document . createElement ( "script" ) ; script . src = `${ endpoint }?callback=${ callback }` ; Object . keys ( args ) . sort ( ) . forEach ( ( key ) => { const val = args [ key ] ; if ( val === undefined ) { return ; } script . src += `&${ key }=${ encodeURIComponent ( val ) }` ; } ) ; window . document . body . appendChild ( script ) ; } export default jsonp ;