Is it possible to reference and load the library using
jQuery.getScript('https://js.squareup.com/v2/paymentform')
This would allow me to deal with a load failure if the library didn't load. I'm asking since getScript should execute the library after loading but it's not.
Related
I'm using Objective C for a Cocoa application on OSX with some local HTML files that get loaded into a Webkit widget. However, a virus could easily modify those HTML files. So, I added a CRC hash to detect tampering, which shows a warning and then closes the application. However, is there a way to additionally protect the local HTML further such as compiling it into the binary of the application itself, or compiling into a single resource file? I noticed with Qt that they have a way to put the HTML into a resource file and then change the webkit URLs to load from there instead of file://. But this is Objective C in this case.
It's not possible from Objective C or Swift like it is from Qt. There is no HTTP URL that you can pass to the WebKit widget to pull content out of the Asset Catalog.
When you load with Dojo's require a module with the wrong module url (mid), it creates an error (timeout) each time you use require(not loaded yet modules) again, regardless you loaded another module successfully afterwards.
Is there a way to clear that errors? Those failed modules seem to be permanent somewhere in dojo.js and they don't seem to be accessible through an API.
ps: I'd be happy even with a core hack to get rid of them.
While learning how to create Lua file output code with the support of LÖVE, I've always hated that LÖVE filesystem handler always saved the specific file somewhere in C:/Documents and Settings/...
How can I create a code that saves a file into a specific folder that I'd like to define (and maybe to change while running the application)?
The love.filesystem library doesn't let you do anything outside the sandbox. However, LÖVE doesn't disable Lua's built in io library, so you can use io.open to open files outside the sandbox and read/write them as normal, as well as other Lua functions like require and loadfile.
It also doesn't restrict loading of external modules, so you can (for example) require "lfs" to load LuaFileSystem and use that, if it is installed.
I've got a 'Main app' and a 'Helper app' (sandboxed, if that matters) that share a private framework including some resources, nib files, sound files etc.
The framework gets called and used by both apps without issues. However from within in the Framework code I have a NSViewController that loads a nib file which is included in its resource folder. This seems to work as long as its called by the 'Main app'. Doing the same with the Helper app (a login item) however does not work and fails with an "Unable to find nib named" error.
The actual 'Framework' is copied to the Main app's 'Frameworks' directory and I use a #rpath in the helper app to find the framework: #executable_path/../../../../Frameworks
This setup seems to work just fine however at runtime it seems the frameworks code tries to find the named Resource under the helper app's Resource folder and not under the Framework's resource folder. Is there a setting or some flag that I can set in xcode to make the framework's always look under the exact path where the framework's executable/library is installed?
It seems the only solution is to copy the framework to the 'Helper' app as well. Resources otherwise do not get loaded if the framework was just a symbolic link to the actual framework placed inside the main app.
What you can do is making your Framework dynamic or shared like described here Dynamic Library Programming Topics
Though it is a bit of a complex process, but a very nice feature.
What else can help you?
Perhaps editing the Library Search Paths or the Framework Search Paths under your Build Settings in Xcode. there you can specify additional search paths to look for.
Even though, I would not copy the Framework to the Main app's dir. I would leave it in one place on your disk, add them to your project (Main and helper) and add the specified search path.
By the way: How is your framework implemented? Is it a folder, is it compiled, or is it only code files?
I am using customized Dojo library. When I load my client application, Dojo load the below two files after loading the "dojox/gfx/svg.js" file.
1. dojox/gfx/shape.js
2. dojox/gfx/path.js
Even though I have included these two files in to my Dojo Custom build, still these two files are always loading in to my client application.
I know the file "dojox/gfx/svg.js" will be load at run time based on the browser type, but why shape.js and path.js files are loading always at run time ?