5 Replies Latest reply: Feb 1, 2010 1:42 PM by William Garrison RSS

Client side (Jquery) examples?

Newbie

Hello Webtrends Nation!

 

Does anyone happen to have any JS client side code (jQuery) examples for data extraction? There are obviously cross-domain issues, but am looking to see if anyone has had success with JSONP.

 

Thanks!

-William

  • Re: Client side (Jquery) examples?
    Newbie

    Just wanted to followup on this for a little extra clarity. The problem I face is that I need to, in some way, make all of my data requests happen client side. I don't have the luxury of hosting a server side page to do the authentication/retrieval. The closest thing I have found is the use of JSONP via jQuery. It isn't perfect, but it allows the browser to perform the ws.webtrends.com authentication and will then return the data. Problem is...we can't seem to access the response...even though we see it.

     

    Any tricks up your sleeves?

     

    Thanks!

    -William

    • Re: Client side (Jquery) examples?
      David Everly Newbie

      Hi William,

       

      I haven't tried to extract data using JS.  I'd think there would be a problem with cross-domain security, but jQuery/JSONP likely has ways around that.  If you are able to share your JS with us, we might be able to help out.

       

      -Dave

      • Re: Client side (Jquery) examples?
        Newbie

        Hey Dave,

         

        Hope all is well!

         

        Obviously we (Kelly Andrews (Solutions Designer) and I) had cross-domain issues, but when using JSONP(getJSON) the browser would do the auth as well as return data.

         

        var url = 'https://ws.webtrends.com/v2/ReportService/profiles/?format=json&callback=?'; $.getJSON(url,function(data){      $("#results").html(data); });

         

        Response:

        [{"ID":"wte9eUWsvC6","name":"*ExactTarget Extensions Network","AccountID":10309,"TimeZoneID":-500},{"ID":"0pMtzvNK6E6","name":"*ExactTarget Infinity","AccountID":10309,"TimeZoneID":-500},{"ID":"evyLBx72Ee6","name":"*ExactTarget Reseller Network","AccountID":10309,"TimeZoneID":-500},{"ID":"wKasmlNKvg6","name":"DC API","AccountID":10309,"TimeZoneID":-800},{"ID":"EiM0Hl2Owg6","name":"DC API  (Copy)","AccountID":10309,"TimeZoneID":-800},{"ID":"JlPCFRdcYo5","name":"email.exacttarget.com Complete Analysis","AccountID":10309,"TimeZoneID":-500},{"ID":"oeEqbdmsXt5","name":"Goodyear TV Rebate","AccountID":10309,"TimeZoneID":-500},{"ID":"7z6mFiCZbg6","name":"Zedesco Sample","AccountID":10309,"TimeZoneID":-700}]

         

        The problem is that we have 0 ways to access the JSONP response. Any ideas?

         

        In the meantime we created a proxy page, but would prefer to not have it.

         

        Thanks,
        W