Mighty Gumball wants a Web appA little more background on Mighty GumballJust a quick start...Turn the engine over...So how do we make requests to web services?How to make a request from JavaScriptMove over XML, meet JSONA quick example using JSONLet’s get to work!Writing an onload handler functionDisplaying the gumball sales dataWatch Out, Detour Ahead!How to set up your own Web ServerHow to set up your own Web Server, continuedBack to the codeLet’s test this already!Impressing the client...Reworking our code to make use of JSONThe Home Stretch...Moving to the Live ServerA Live Test Drive...It’s a cliffhanger!Remember, we left you with a cliffhanger? A bugSo, what do we do now?!What Browser Security Policy?Acceptable Behavior for JavaScript codeUnacceptable Behavior for JavaScript codeSo, what are our options?Meet JSONPBut what is the “P” in JSONP for?Let’s update the Mighty Gumball web appTest drive your new JSONP-charged codeImproving Mighty GumballStep 1: Taking care of the script element...Step 2: Now it’s time for the timerA time-driven test driveStep 3: Reimplementing JSONPFirst, let’s set up the JSONP URLNext, let’s create a new script elementHow do we insert the script into the DOM?Now let’s write the code to insert the script into the DOMWe almost forgot: watch out for the dreaded browser cacheOne more TIME test driveHow to remove duplicate sales reportsUpdating the JSON URL to include the lastreporttimeTest drive lastReportTimeA Special Message from Chapter 7...