Thanks Sam! (as I face-palm) Regards
Matt Moody Sales Engineer MarkLogic Pty Ltd [email protected]<mailto:[email protected]> Mobile: +61 415 564 355 From: <[email protected]> on behalf of Sam Mefford <[email protected]> Reply-To: MarkLogic Developer Discussion <[email protected]> Date: Thursday, 9 February 2017 at 8:14 am To: MarkLogic Developer Discussion <[email protected]> Subject: Re: [MarkLogic Dev General] How to pass parameters between JavaScript functions? I think you need to add "return" before parseFlights(resp); in the getFlightsInAir function. Sam Mefford Senior Engineer MarkLogic Corporation [email protected]<mailto:[email protected]> Cell: +1 801 706 9731 www.marklogic.com<http://www.marklogic.com> This e-mail and any accompanying attachments are confidential. The information is intended solely for the use of the individual to whom it is addressed. Any review, disclosure, copying, distribution, or use of this e-mail communication by others is strictly prohibited. If you are not the intended recipient, please notify us immediately by returning this message to the sender and delete all copies. Thank you for your cooperation. On 2/8/2017 2:09 PM, Matt Moody wrote: > > ML JavaScript newbie question… > > > > I’m simply trying to pass the > > response from my httpGet call into my > parseFlights function. The httpGet > > call returns a valid JSON > document. However, it looks like the parameter > > that gets passed to > the parseFlights function is always blank. > > > > Why? > > > > > > declareUpdate(); > > > > var username = 'moody1'; > > var apiKey = '#########'; > > > > var fxml_base_url = > 'http://flightxml.flightaware.com/json/FlightXML2/'; > > var url_endpoint = 'SearchBirdseyeInFlight?howMany'; > > var url = > > fxml_base_url + url_endpoint; > > > > function getFlightsInAir() { > > var > > resp = fn.subsequence(xdmp.httpGet(url, > > > {"authentication":{"method":"basic","username":username,"password":apiKey}}), > 2, 1); > > > > // return resp; // this displays a valid JSON > document > > parseFlights(resp); // pass the JSON document to > parseFlights > function > > }; > > > > function parseFlights(flights) { > > > return flights; // this data is always blank > > }; > > > > getFlightsInAir(); > > > > > > > > Any help would be appreciated!! > > * * > > *Matt Moody* > > Sales Engineer > > MarkLogic Pty Ltd > > [email protected]<mailto:[email protected]> <mailto:[email protected]><mailto:[email protected]> > > Mobile: +61 415 564 355 > > Skype: matt.moody.ML > > www.marklogic.com<http://www.marklogic.com> <http://www.marklogic.com/><http://www.marklogic.com/> > > .png > > > > _______________________________________________ General mailing list > <mailto:[email protected]> [email protected]<mailto:[email protected]> Manage your subscription at: > <http://developer.marklogic.com/mailman/listinfo/general> http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________ General mailing list [email protected] Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
