Closed GoogleCodeExporter closed 8 years ago
Can you provide an example call, or describe which api endpoint this is in
reference to?
Original comment by jehiah
on 16 Mar 2011 at 2:29
I'm using this code, with my login/key pair.
It works for xml, but if I change to format=txt I get a cross origin exception
from google chrome 10.
function shorten_url_with_bitly(myUrl) {
var bitly_login = "xxx";
var bitly_apiKey = "yyy";
var bitly_request = "http://api.bitly.com/v3/shorten?login=" + bitly_login + "&apiKey=" + bitly_apiKey + "&longUrl=" + encodeURIComponent(myUrl);
var bitly_link = null;
try {
var xhr = new XMLHttpRequest();
xhr.open("GET", bitly_request + "&format=xml");
xhr.onreadystatechange = function() {
if(xhr.readyState == 4) {
if(xhr.status==200) {
// something done here after a successful request
}
}
}
xhr.send();
}
}
Original comment by paolocas...@gmail.com
on 16 Mar 2011 at 2:39
thanks for the example; this should be fixed now.
Original comment by jehiah
on 16 Mar 2011 at 3:06
correct, this seems to be fixed now
Original comment by paolocas...@gmail.com
on 16 Mar 2011 at 3:17
Original issue reported on code.google.com by
paolocas...@gmail.com
on 16 Mar 2011 at 2:23