Why [{"ab":"cd"}] does not work with Opera? jQuery $.ajax()

Forums » General Opera topics » User JavaScript

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

27. May 2010, 17:40:21

daniello

Posts: 2

Why [{"ab":"cd"}] does not work with Opera? jQuery $.ajax()

Opera Version 10.53
Event 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

27. May 2010, 22:19:03

xErath

javascript guru

Posts: 6588

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/

28. May 2010, 03:53:00

daniello

Posts: 2

Originally posted by xErath:

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 ?



Yes, totally right wink

Forums » General Opera topics » User JavaScript