|
I have tried sending this string from my asp page.
I get no return and the number of requests does not increment. I have an onblur for the zipcode field that calls a function amidone in the function I call:
I am a fair ASP programmer, this jquery/JSON stuff is very new to me. Can you tell what I have done wrong? Or where do I go for help? |
|
Try this example out:
It uses jQuery.axax and explicitly sets the dataType to "JSONP". Also, because you are using the REST api you don't need to authorize a domain on the management console. Just make sure you're using an active Authentication Token in the query parameter data. Thank you, I was able to get a result set. I have spent a bit of time trying to figure out how to reference the elements of the data return. I have tried serializeArry .data() and many other options as well as data[0].delivery_line1… I really appreciate your assistance and I am sure it is simple.
(13 Feb, 17:20)
Questions ♦♦
Not a problem. The data that comes back is a JSON so it's actually just like a javascript array that consists of zero or more javascript objects. Supposing there's one valid address suggestion you would access the dpv_match_code field like this: data[0].analysis.dpv_match_code
(13 Feb, 17:21)
Jeffrey - SmartyStreets ♦♦
I recommend setting a javascript breakpoint using your browser's developer tools. Set the breakpoint right after the response comes back (like on line 24 of the Github example in the last message). Once you are stopped on that breakpoint you can play around with the 'data' variable in the console window or in the 'locals' section of the scripts window. I've attached a few screenshots of my debug session that hopefully clear up this explanation. Hope that helps...
(13 Feb, 17:21)
Jeffrey - SmartyStreets ♦♦
I meant to get back to you. I did figure it out. my main problem was I did not use the proper variable name! Thank you very much for your time.
(13 Feb, 17:22)
Questions ♦♦
|
Follow this question
By Email:Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
- *italic* or _italic_
- **bold** or __bold__
- link:[text](http://url.com/ "title")
- image?
- numbered list: 1. Foo 2. Bar
- to add a line break simply add two spaces to where you would like the new line to be.
- basic HTML tags are also supported
Tags:
Asked: 13 Feb, 17:16
Seen: 241 times
Last updated: 13 Feb, 17:22
This almost looks like an invalid cross domain request. The get Json call needs datatype jsonp or the browser will block it.
OK, I used Chrome and opened the console and got this after a request.
XMLHttpRequest cannot load https://api.qualifiedaddress.com/street-address/?street=Here+At+Home&street2=&city=Whatsit&state=ID&zipcode=98554&candidates=1&auth-token=[removed].
Origin http://[removed] is not allowed by Access-Control-Allow-Origin.
Does this make sense? I added the www.nwcctan.com on the Authorized Domains under the Verification API page.