4 Replies Latest reply on Aug 8, 2014 12:52 PM by Ryan Rutan

    ajax cross domain for Jive api v3



      My current code is this:




            $.each(data, function(i,item){           





      The only problem I get is that I have:

      throw 'allowIllegalResourceCall is false.'; which causes an error, How can I cut this line out in javascript?

        • Re: ajax cross domain for Jive api v3

          Hi Taras,


          You may have already seen this, but the throw string is explained in detail in What is the purpose of the JSON Security String?


          An example of its removal using a regular expression (in Python) can be found here Jive REST Rest API v3.7


          In jQuery, you can use a regular expression to clean out that line in the "dataFilter" setting in an $.ajax or $.ajaxSetup call.



            • Re: ajax cross domain for Jive api v3

              That's what i thought I can do, but when i did dataFilter: function(data, type){}, the type would come in as jsonp, but the data was undefined, I might have to play around with it a little, more, this seems like a good answer though.

                • Re: ajax cross domain for Jive api v3

                  I have a node.js app and also a python script which call the jive rest apis.

                  Here's small code snippet I have in both these to clean the jive response

                  This might help you write a code for your case


                  In node.js app

                  request(getUserRequest, function (error, response, body) {

                         userData = JSON.parse(body.replace(/throw.*;/, "").trim())



                  You will have to write a client side version similar to this


                  Here's the code I wrote in my python scripts to clean this


                  import re

                  import json

                  jive_response = re.sub('\A.*[;]', "", jive_response.text).encode('utf8', 'ignore')

                  json_response = json.loads(jive_response)