Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute:

I've been trying the code at: https://gist.github.com/Exeu/4674423 this is a code that connects to amazon wsdl and retrieve product information. so far I have not been able to make it work. The code consist of a index.html, ama_funtion.js, search.php, AmazonECS.class.php. The index file loads and you insert the item name you want choose the category and other params, then when you click in the search link it goes to the ama_function.js and it make and ajax request to the search.php which have the passwords and keys to connect to the wsld, then it request the info from Amazon and return it as JSON to ama_function.js.

I have test ama_funtions.js to see if the index.html file connects to it, and it does, I did put an alert to show the input in the search box at index.html. Also I have test the search.php, I have manualy put the values in the search.php file and it connects to amazon and retrieve the product information as JSON object. the problem is that there is not a success callback as no data return to ama_funtions.js from search.php to be rendered. I know this as I tested it by adding an error function

$.ajax({
      url: "search.php",
      dataType: 'json',
      type: 'GET',

              error: function () {
                  alert("NO DATA");
              },

and it did show me the alert, also I have tried to change the ->

data: "q="+value+"&category="+cat+"&country="+country+"&page="+page,

for ->

data: {
          q : value,
          category : cat,
          country : country,
          page : page }

nothing works I am crazy looking to solve this, I will appreciate someone that help us with this. Please see a working example which belong the person sharing the code -> http://amazonecs.pixel-web.org. This is the way is suppose to work but it doesn't.

Regards

share|improve this question
    
Use Inspect Element-> Network tab and see if the ajax call is working. – Hackerman Oct 23 '13 at 23:33
    
ajax call is working but data no data is coming back, I check the php file and manually imput the params it returns json objects but ajax doesnt received it. – visionez Oct 26 '13 at 20:20
    
I don't see the success or .done function part in your ajax call – Hackerman Oct 26 '13 at 21:12
    
Hi There, Please see the code at: gist.github.com/Exeu/4674423 this will show you the whole code – visionez Oct 27 '13 at 18:11
    
in the success: function(data){ , add this console.log(data); .....but it seems that your code never go to the success function...are you get a dsiplay alert abot 'Data not Found' ??...if that is the case then change the error code to this : error: function(jqXHR, textStatus, errorThrown) { console.log(textStatus, errorThrown); } – Hackerman Oct 27 '13 at 22:47

1 Answer 1

$.ajax({
    url: "search.php",
    dataType: 'json',
    type: 'GET',

    error: function () {
        alert("NO DATA");
    },

    data: "q="+value+"&category="+cat+"&country="+country+"&page="+page,

    data: {
        q : value,
        category : cat,
        country : country,
        page : page 
    }
})
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.