How do I retrieve data from MSSQL Server using Javascript? I am used to doing things in PHP, but I want to have an interactive form which is able to display Sales Tax after user types in his zip code.

My query is similar to: "select top z.rate from zipcodes z where z.zipcode = $zipcode"

How do I retrieve data from MSSQL Server using Javascript? I am used to doing things in PHP, but I want to have an interactive form which is able to display Sales Tax after user types in his zip code.

My query is similar to: "select top z.rate from zipcodes z where z.zipcode = $zipcode"

I've got the data in a JSON object now. So how do I get the value out of it using Javascript?

For example, I have a change event on the zip code input tag, and now I want to reference the JSON object at a given URL, eg,mydata.php.

My JSON object that is returned by the mydata.php script is:

var salesTaxJSON = { 
"zipcodes" : [ { "Zip" : 19044, "City" : "HORSHAM", "County" : "MONTGOMERY", "State" : "PA", "CombinedTax" : 0.06}]};
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.