Browse files

Merge branch 'master' of github.com:PaulKinlan/WebIntents

  • Loading branch information...
2 parents 13e6c32 + c3497ca commit cb83612eee380d19c6e8421dbdfb86781492e2b4 Paul Kinlan committed Feb 4, 2012
Showing with 13 additions and 3 deletions.
  1. +13 −3 server/examples/pages/usage/startActivity/index.html
View
16 server/examples/pages/usage/startActivity/index.html
@@ -8,7 +8,7 @@
var startButton = document.getElementById("startActivity");
startButton.addEventListener("click", function() {
var intent = new Intent(
- "http://webintents.org/share");
+ "http://webintents.org/share", "text/uri-list", location.href);
window.navigator.startActivity(intent);
}, false);
@@ -17,9 +17,19 @@
{% endblock %}
{% block content %}
<section>
-<pre>var intent = new Intent("http://webintents.org/share");
+ <h2>Explanation</h2>
+ <p>
+ It is simple to invoke an action:
+ </p>
+ <ol>
+ <li>Instantiate an Intent object with an action, data type and the data you want to send</li>
+ <li>Call window.naviagator.startActivity with the intente object and option success and failure callbacks</li>
+ </ol>
+ <h2>Code</h2>
+<pre>var intent = new Intent("http://webintents.org/share", "text/uri-list", location.href);
-window.navigator.startActivity(intent);</pre>
+window.navigator.startActivity(intent, function(data) { /* on success */ });</pre>
+ <h2>Example</h2>
<div>
<button id="startActivity">Click to Start Activity</button>
</div>

0 comments on commit cb83612

Please sign in to comment.