newyankeecodeshop / gajavascript Goto Github PK
View Code? Open in Web Editor NEWLibrary to simplify working with JavaScript and UIWebView.
Library to simplify working with JavaScript and UIWebView.
Hey, I was reading through your readme and I think some of the documentation is outdated. For ex.
id document = [scriptEngine documentObject];
Shouldn't this be
id document = [webView documentJS];
Also you state:
Now you can access the "document" or "window" object via the GAScriptEngine instance, or create your own objects using [GAScriptEngine newScriptObject:].
Am I missing something here, I don't see any properties document or window in the GAScriptEngine interface?
thanks for any help
Block callbacks were not being invoked when passed in via [GAScriptObject callFunction:withArguments:]. The block objects were not being added to the script engine instance.
Hello,
I need basic help to integrate your library with HighCharts. I'm Objective C developer and write native iOS apps. But recently have got a project where i need to display highly graphical and animated charts. I've choosen HighCharts & amCharts for this purpose but none of them can be used in my native iOS application. But your framework seems good to bridge the gap. How can I use HighCharts and your Javascript framework with my native code without having backend server? Please help. (A simple example will be great)
BR,
~newbie to Javascript & Web development.
I was banging my head on the wall trying to get this to work and then duh - I totally forgot about using static libs and using the --all_load and --ObjC linker flags. Might want to add something about that on the readme.md. Thanks for your work in this project!
The <iframe> element created by the script runtime is visible in the hosted UIWebView. The code that tries to set the CSS display to none is not correct.
Hi there,
This looks to be a great framework which I am trying to use to is max!
I have the following code to grab my document from my UIWebView
and a subset of all the div
elements:
id document = [webView documentJS];
id myElement = [document getElementsByClassName:@"div"];
myElement
is of the type GAScriptObject
(as expected), but how can I get information about the innerHTML
of each div
? Or more specifically, filter by an attribute?
Ideally, I am trying to get a reference to an element which does not have an id or a name (but I know it's text and a few other attributes).
Any advice would be super awesome. I'm stuck here.
Cheers,
Brett
The demo project is broken and the functionality is clunky.
So I have narrowed down the issue I am having to trying to communicate from JS back to objC via GAJavascript.performSelector.
If you take a look at a sample project I created, there is one line that in boxes.html that does a console.log, if I remove that line of code it will perform as desired (appends a h1 to all the webviews that says "I LOVE HTML"), otherwise the h1 is never appended.
I have worked around this problem for the time being by changing line 152 of ga-js-runtime.js to the following:
window.setTimeout(function() { location.replace("ga-js:makeLotsaCalls"); }, 500);
Not exactly sure why this is causing an issue in my scenario, any ideas?
I was wondering how is possible to create an instance of a ObjC object from a JS script.
Given some javascript that takes a callback function with three arguments, the second of which is an array:
function someCoolFunction (obj) {
/* ... */
obj.callback('First arg', [1, 2, 3], 'third arg');
}
Using GAJavaScript to call "someCoolFunction":
GAScriptEngine* scriptEngine = [self scriptEngine];
GAScriptObject* obj = [scriptEngine newScriptObject];
[obj setFunctionForKey:@"callback" withBlock:^(NSArray* arguments)
{
assert([arguments count] == 3); // fails
}];
[scriptEngine callFunction:@"someCoolFunction" withObject:obj];
The number of arguments is actually 5. The middle array is flattened out into the entire argument list.
I am working on a project which has 7-9 UIWebViews each with their own GAScriptEngine. I was having a problem where only the last rendered one would work properly. It turns out that if I didn't use a proper caching policy with my NSURLRequest it would work this way. Not sure what a good workaround is but FYI.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.