Skip to content

app-bootstrap/JsWebView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JsWebView

Preview

preview

Usage

Installation

copy JsWebViewController.h, JsWebViewController.m into your project.

Add the following import to the top of the file:

#import "JsWebViewController.h"

Configuration

JsWebViewController *view = [[JsWebViewController alloc] init];
...
view.url = url;

Usage

var callback = function() {

  $('#pushView').addEventListener('click', function() {
    JSBridge.invoke('pushView', {
      url: 'index.html'
    });
  }, false);

  $('#popView').addEventListener('click', function() {
    JSBridge.invoke('popView');
  }, false);

  $('#setTitle').addEventListener('click', function() {
    JSBridge.invoke('setTitle', 'newTitle');
  }, false);
};

document.addEventListener('JSBridgeReady', function() {
  callback();
}, false);

License

The MIT License (MIT)

Copyright (c) 2015 xdf

About

An iOS bridge between Objective-C and JavaScript.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published