3

I'm starting from scratch here just trying to get the basic connection between intel and parse working. I set up the parse web service in Intel-XDK and copied the necessary javascript test code from Parse into my js file. I attached a button click to trigger the parse code and this is what I get. enter image description here The parse object "error.message" says unauthorized when I cancel the window. In addition to this problem, when I test it on my device, I don't even get any of that, nothing happens at all. No Login window, no error message. What gives?

var Parse; 

Parse.initialize('*******dDOsWAqqUKjQMFN','*******O1bcmTUj7o7Bep');

var document;

document.addEventListener("DOMContentLoaded", function() { var clickCount = 0;

document.getElementById("myJsTest").addEventListener("click", function() {
    clickCount++;

    var venue = Parse.Object.extend("venue");
         venue = new venue();

        venue.save({
          score: 1337,
          playerName: "Sean Plott",
          cheatMode: false
        }, {
          success: function(venue) {
            // The object was saved successfully.
              document.getElementById("clickCounter").textContent = "successful post";

          },
          error: function(venue, error) {
            // The save failed.
            // error is a Parse.Error with an error code and message.
               document.getElementById("clickCounter").textContent = error.message;
          }
        });


    document.getElementById("clickCounter").innerText = "Click Count: " + clickCount;
});

});

Spilot
  • 1,495
  • 8
  • 29
  • 55
  • If you runs the file through a browser (not through XDK) does the console show any errors? – Script47 Jan 22 '16 at 10:15
  • yes it says '401' unauthorized. – Spilot Jan 22 '16 at 22:45
  • can u share some code snippet? – krisrak Jan 27 '16 at 03:26
  • @krisrak I've added the code snippet in the main body of the question – Spilot Jan 27 '16 at 13:37
  • could be a setting on parse that is not allowing requests, i have an old parse app working, this uses older js, try with this: http://www.parsecdn.com/js/parse-1.2.12.min.js, or what version are js are u using? – krisrak Jan 28 '16 at 01:16
  • Parse is ending their hosted services - are you still interested in the answer? http://blog.parse.com/announcements/moving-on/ – patrickmdnet Jan 30 '16 at 16:43
  • Yes. I have seen the announcement from parse and will continue to use them for the limited time that I have. I have done some careful study of this issue and the problem lies somewhere in the Intel web service for Parse I had to set up. I think once I set it up correctly it may work, but I'd still appreciate any extra guidance in case I still run into bugs. – Spilot Feb 01 '16 at 01:07
  • @patrickmdnet do you have any help for me? – Spilot Feb 03 '16 at 17:48

0 Answers0