Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Cross-domain (for analytics)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Danny Ayers  
View profile  
 More options Jul 30, 6:00 am
From: Danny Ayers <danny.ay...@gmail.com>
Date: Thu, 30 Jul 2009 03:00:01 -0700 (PDT)
Local: Thurs, Jul 30 2009 6:00 am
Subject: Cross-domain (for analytics)
I've run up against a cross-domain Ajax problem, essentially I want to
do something like:

(in http://hostA.com/page.html)

<script>
        $.ajax({
                type: "POST",
                url: "http://hostB.com/service.php",
                data: dataText,
...

but this promptly produces an [Exception... "Access to restricted URI
denied"  code: "1012"...

The thing is, unlike most of the related scenarios I've found, I don't
actually want anything back from the server, I just want to send off
some page access data.

Because ultimately I want this thing to be easy for end-users, the use
of a server-side proxy is something I'd like to avoid. I'm pretty sure
this should be doable /somehow/ -  it appears that Google Analytics
must get around the problem, but I haven't been able to suss out how.

Suggestions?

(the code I'm working on is linked from http://hyperdata.org/wiki/wiki/TtrackerHowItWorks
)

Cheers,
Danny.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leonardo K  
View profile  
 More options Jul 30, 9:03 am
From: Leonardo K <leo...@gmail.com>
Date: Thu, 30 Jul 2009 10:03:52 -0300
Local: Thurs, Jul 30 2009 9:03 am
Subject: Re: [jQuery] Cross-domain (for analytics)

I think this will help you.
http://snook.ca/archives/javascript/cross_domain_aj/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
getify  
View profile  
 More options Jul 30, 9:24 am
From: getify <get...@gmail.com>
Date: Thu, 30 Jul 2009 06:24:50 -0700 (PDT)
Local: Thurs, Jul 30 2009 9:24 am
Subject: Re: Cross-domain (for analytics)
As mentioned in the comments of the thread Leonardo sent, you might
try flXHR, which is a client-side cross-domain Ajax proxy (invisible
flash). flXHR has an indentical API to normal native XHR calls. And
there's a very easy to use jQuery plugin that makes it ridiculously
simple to integrate.  http://flxhr.flensed.com/jquery.php

On Jul 30, 8:03 am, Leonardo K <leo...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
getify  
View profile  
 More options Jul 30, 9:39 am
From: getify <get...@gmail.com>
Date: Thu, 30 Jul 2009 06:39:57 -0700 (PDT)
Local: Thurs, Jul 30 2009 9:39 am
Subject: Re: Cross-domain (for analytics)
However, re-examining your issue, it looks like all you would need to
do is set your data type to JSON, which CAN be done cross-domain. And
since you aren't needing a response, just make sure your server can
accept the data as GET instead of as POST (like in your code above),
and you should be fine.

But, if you must POST cross-domain, then flXHR and jquery.flXHRproxy
are good options for you.

On Jul 30, 8:24 am, getify <get...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard Wallis  
View profile  
 More options Jul 30, 9:44 am
From: Richard Wallis <richard.wal...@talis.com>
Date: Thu, 30 Jul 2009 06:44:39 -0700 (PDT)
Local: Thurs, Jul 30 2009 9:44 am
Subject: Re: Cross-domain (for analytics)

Google Analytics does it by passing their parameters on the src URI of
an image call which doesn't hit cross domain problems:

http://www.google-analytics.com/__utm.gif?utmwv=4.3.1&utmn=187577837&...

The code to dynamicly insert the <img> coming from the analytics
script http://google-analytics.com/ga.js


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Laurian  
View profile  
 More options Jul 30, 8:40 am
From: Laurian <laur...@gmail.com>
Date: Thu, 30 Jul 2009 05:40:39 -0700 (PDT)
Local: Thurs, Jul 30 2009 8:40 am
Subject: Re: Cross-domain (for analytics)
You may try http://plugins.jquery.com/project/flXHR

Laurian

On Jul 30, 11:00 am, Danny Ayers <danny.ay...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Danny Ayers  
View profile  
 More options Jul 30, 7:47 pm
From: Danny Ayers <danny.ay...@gmail.com>
Date: Thu, 30 Jul 2009 16:47:56 -0700 (PDT)
Local: Thurs, Jul 30 2009 7:47 pm
Subject: Re: Cross-domain (for analytics)
Many thanks folks.

I wound up opting for a hidden form (thanks for the twit Laurian!) -
it allowed me to do a sweet RESTful POST and because I didn't need
anything back from the server there was no need to get my hands dirty
with iFrames. Maybe jQuery could benefit from such a feature?

Anyhow I did a little write-up of the options I found for cross-domain
Ajax at:

http://blogs.talis.com/n2/archives/770

Cheers,
Danny.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google