javascript - JSONP Ajax Syntax -


I am trying to alert my webpage visitor with the country code provided by the JSONP endpoint. However, I can not seem to do this work! And all the answers on the web seem confusing!

has returned from the end point:

  {"pcCartCt": 0, "pcCountryCode": "au", "pcCountrySite" False, "pcIsTrusted": false, "pcLanguageCookie": "en-us": "pcIsCdc": "pcIsCdc": false, "pcIsDiscount": false, "pcIsGdEmployee": false, "pcIsTrusted": " "PcRodEmail": "pcRepEmail": "" "pcRepExt": "" "pcRepName": "" "pcSelectedCurrFullDesc": "United States Dollar $ (Transactional)", "pcSelectedCurrType": "US Dollar "PcSetLanguageLogo": true, "pcShopperId": ""}   

To make this work, I need to specify a for the first time "microgid" and a callback Function p Rog_id . In the callback, I need a warning message containing pcCountryCode .

How do I do this?

should return the endpoint:

  myprogid ({"pcCartCt": 0, "pcCountryCode": "and", "pcCountrySite": "WWW", "pcExpDomCt": 0, "pcFirstName": "" "pcIsCdc": false, "pcIsDiscount": false, "pcIsGdEmployee": false, "pcIsTrusted ":" PcRanguageCookie ":" pcReadName ":" pcRodName ":" pcReadEmail ":" "" pcRepEmail ":" "" pcRepExt ":" "" pcRepName ":" "" pcSelectedCurrFullDesc ":" United States Dollar $ (lane) -de-related) "," pcSelectedCurrType ":" US Dollar "," pcSetLanguageLogo ": true," pcShopperId ":" "}});   

I do not have your question about parsing several parameters. JSONP expects just one special parameter: callback = myprogid . This parameter should be used as the name of the function at the beginning of the response.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -