Same domain load for SceneJS.Load broken
Reported by lindsay.kay (at xeolabs) | May 8th, 2010 @ 04:14 AM | in V0.7.4
IE. with no proxy on SceneJS.Scene, and URI in same domain. Works ok for SceneJS.LoadCollada, but for SceneJS.Load of remote teapot example:
Symptoms
Two cases present in which error occurs.
1) With URI of form http://scenejs.org/library/../asset.js the following error is reported:
Load failed - 0 - - uri: http://scenejs.org/library/v0.7/assets/examples/orange-teapot/orange-teapot.js
Scene destroyed: scene0
SceneJS reset
scene0: Loading asset from local domain http://scenejs.org/library/v0.7/assets/examples/orange-teapot/orange-teapot.js
2) When URI of form http://www.scenejs.org/library/../asset.js, the content is received but I neglected to actually evaluate it. This worked for the cross-domain load with this URI because the JSONP mechanism of inserting into a script tag took care of evaluation.
Solution
Assuming (1) is a same-domain security violation, report a
suggestion to fix the URL's "www".
For (2), in SceneJS.Load do the following:
SceneJS.Load.prototype._parse = function(data, onError) {
if (data._render) {
return data;
}
if (data.error) {
onError(data.error);
}
try {
var data = eval(data); // Same-domain
if (data.error) {
onError(data.error);
}
return data;
} catch (e) {
onError('Error parsing response: ' + e);
}
Comments and changes to this ticket
-
lindsay.kay (at xeolabs) May 8th, 2010 @ 08:00 AM
- State changed from open to resolved
-
lindsay.kay (at xeolabs) May 8th, 2010 @ 08:05 AM
- no changes were found...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
SceneJS provides easy access to WebGL through a simple and declarative JavaScript API. The SceneJS API is functional, which enables its scene definitions to be really compact and expressive, while hooking into other JavaScript code just that little bit more smoothly.