Hi,
I’m trying to load a library from a webfile, but get the error;
Failed to load resource: the server responded with a status of 404 (OK) http://127.0.0.1:8080/2EF0014230D94720EAD4AD00457D5E5A/files/%7B2175-8421-2381-6087-9726%7D/createjs-2013.12.12.min.js
The code in the Open event is: (I know I should make wf a shared property, but for the sake of this problem, I left it like this)
dim f as FolderItem
dim wf as WebFile
#if DebugBuild
f = GetFolderItem("").Parent.Child("createjs-2013.12.12.min.js")
#else
f = GetFolderItem("").Child("createjs-2013.12.12.min.js")
#Endif
if f.Exists then
wf = WebFile.Open(f)
LoadLibraries("setTimeout(XojoCustom.alwaysbusy.abwebcanvas.init('"+ self.controlID + "'),10);", wf.URL)
end if
RaiseEvent Open()
The following code, using the http:// works fine:
LoadLibraries("setTimeout(XojoCustom.alwaysbusy.abwebcanvas.init('"+ self.controlID + "'),10);", "http://code.createjs.com/createjs-2013.12.12.min.js")
This is my SetupJavascriptFramwork:
Dim s() as String
// Created by alain on 25/09/2014.
s.Append ""
s.Append "var stage, w, h;"
s.Append "var controlID;"
s.Append ""
s.Append "XojoCustom.alwaysbusy.abwebcanvas.init = function init(cControlID) {"
s.Append " if (window.top != window) {"
s.Append " document.getElementById('header').style.display = 'none';"
s.Append " }"
s.Append ""
s.Append " controlID=cControlID;"
s.Append ""
s.Append " stage = new createjs.Stage(controlID);"
s.Append ""
// grab canvas width and height for later calculations:
s.Append " w = stage.canvas.width;"
s.Append " h = stage.canvas.height;"
s.Append " console.log(w + 'x' + h);"
s.Append "};"
Return Join(s, "")
I’ve tried putting createjs-2013.12.12.min.js next to the exe and in the resources folder. If it’s next to the exe, the GetFolderItem("").Parent.Child(“createjs-2013.12.12.min.js”) works, wf = WebFile.Open(f) gives no error but loadlibraries gives the above error in the browser.
Thanks again in advance!
Alain
Skipping some steps to do some quick tests is never good. Thought this was just needed for multiple sessions.