?
Solved

Best Buy Remix API using JQuery

Posted on 2015-01-08
2
Medium Priority
?
222 Views
Last Modified: 2015-01-08
I've created the following code, but now I need to show the results.  How do I do that?

    var apiKey = "zy5hzrxazsfe9f9uyehqpb5c";

    var storeLocation = params.id.split('|');

    var myURL = "http://api.remix.bestbuy.com/v1/stores(area(" + storeLocation[1] + "," + storeLocation[0] + "))?format=json&callback=?&apiKey=" + apiKey;

    $.ajax({
        type: "GET",
        url: myURL,
        cache: true,
        success: function () {
            alert('success');
        },
        dataType: 'json'
    });
0
Comment
Question by:Ray Turner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 33

Accepted Solution

by:
Big Monty earned 2000 total points
ID: 40538747
add a variable to your success function:

   var apiKey = "zy5hzrxazsfe9f9uyehqpb5c";

    var storeLocation = params.id.split('|');

    var myURL = "http://api.remix.bestbuy.com/v1/stores(area(" + storeLocation[1] + "," + storeLocation[0] + "))?format=json&callback=?&apiKey=" + apiKey;

    $.ajax({
        type: "GET",
        url: myURL,
        cache: true,
        success: function ( results ) {
           // alert('success');
            alert(results)l);
        },
        dataType: 'json'
    });

Open in new window


that'll spit out all of the data that it received. Assuming it's in json, you can then parse it with jquerys parse function:

http://api.jquery.com/jquery.parsejson/
0
 

Author Closing Comment

by:Ray Turner
ID: 40539047
Thanks!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question