You need to be logged in to post in the forums. If you do not have an account, please sign up first.
Why [{"ab":"cd"}] does not work with Opera? jQuery $.ajax()
Opera Version 10.53Event thread: DOMContentLoaded
ReferenceError: Security violation
Code:
<html>
<head>
<title>opera test</title>
</head>
<body>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$.ajax({
url: 'http://api.jamendo.com/get2/id+name+url+stream+duration+album_name+album_url+album_id+artist_id+artist_name/track/json/track_album+album_artist/?n=2',
context: document.body,
cache: true,
success: function(data){
console.log(data);
},
error: function(XHR, textStatus, errorThrown) {
console.log(errorThrown);
}
});
});
</script>
</body>
</html>
Excerpt JSON String
[
{
"id":211,
"name":"La m\u00e8re elle exag\u00e8re",
"url":"http:\/\/www.jamendo.com\/track\/211",
"stream":"http:\/\/stream28.jamendo.com\/stream\/211\/mp31\/05%20-%20Echo%20lali%20-%20La%20mere%20elle%20exagere.mp3?u=0&h=97f9941737",
"duration":156,
"album_name":"Echo lali",
"album_url":"http:\/\/www.jamendo.com\/album\/29",
"album_id":29,
"artist_id":13,
"artist_name":"Echo lali"
}
...
]
FF and WebKit based browser can convert the array to an object. why it doesnt work in opera?
i really like opera and dragonfly.
greets. daniel
Originally posted by daniello:
Event thread: DOMContentLoaded
ReferenceError: Security violation
Originally posted by daniello:
url: 'http://api.jamendo.com/
I presume you're doing the XHR from that same domain ?
For a collection of user scripts visit
http://my.opera.com/xErath/blog/
http://my.opera.com/xErath/blog/
Originally posted by xErath:
Originally posted by daniello:
Event thread: DOMContentLoaded
ReferenceError: Security violationOriginally posted by daniello:
url: 'http://api.jamendo.com/
I presume you're doing the XHR from that same domain ?
Yes, totally right
