pinmarklet.js?r=29574598.124235574:1 Uncaught TypeError: Cannot read property 'substr' of undefined
at Object.makeImageless (pinmarklet.js?r=29574598.124235574:1)
at Object.process (pinmarklet.js?r=29574598.124235574:1)
at a (pinmarklet.js?r=29574598.124235574:1)
function OnStart()
{
lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
web = app.CreateWebView( 1.0, 1.0 );
web.LoadUrl( 'test.html' );
lay.AddChild( web );
app.AddLayout( lay );
}
function Email()
{
var url = "mailto:?Subject=Simple Share Buttons&Body=I%20saw%20this%20and%20thought%20of%20you!%20 https://simplesharebuttons.com";
app.OpenUrl( url );
}
function Facebook()
{
var url = "http://www.facebook.com/sharer.php?u=https://simplesharebuttons.com";
app.OpenUrl( url );
}
function Google()
{
var url = "https://plus.google.com/share?url=https://simplesharebuttons.com";
app.OpenUrl( url );
}
function Twitter()
{
var url = "https://twitter.com/share?url=https://simplesharebuttons.com&text=Simple%20Share%20Buttons&hashtags=simplesharebuttons";
app.OpenUrl( url );
}
<html>
<head>
<meta name="viewport" content="width=device-width">
<script src='file:///android_asset/app.js'></script>
<style>
.share-buttons {
width: 35px;
padding: 5px;
border: 0;
box-shadow: 0;
display: inline;
position: fixed;
bottom: 0;
display:block;
}
.email {
display:block;
}
.facebook {
display:block;
}
.google {
display:block;
}
.pinterest {
display:block;
}
.twitter {
display:block;
}
<div id="share-buttons" style="height: 50 px;">
<a href="javascript:app.Execute('Email()')" class= email>
<img src="https://simplesharebuttons.com/images/somacro/email.png" alt="Email" />
</a>
<!-- Facebook -->
<a href="javascript:app.Execute('Facebook()')" target="_blank" class=facebook>
<img src="https://simplesharebuttons.com/images/somacro/facebook.png" alt="Facebook" />
</a>
<!-- Google+ -->
<a href="javascript:app.Execute('Google()')" target="_blank" class=google>
<img src="https://simplesharebuttons.com/images/somacro/google.png" alt="Google" />
</a>
<!-- Pinterest -->
<a href="javascript:(function(){var e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','http://assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e)})()" class=pinterest>
<img src="https://simplesharebuttons.com/images/somacro/pinterest.png" alt="Pinterest" />
</a>
<!-- Twitter -->
<a href="javascript:app.Execute('Twitter()')" target="_blank" class=twitter>
</body>
</html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<script src='file:///android_asset/app.js'></script>
<div class= title>The Title</div>
<style>
.title {
font-size: 100;
font-family: cursive;
width: 100%;
margin-top: 2em;
text-align: center;
color: white;
.share-buttons {
width: 35px;
padding: 5px;
border: 0;
box-shadow: 0;
display: inline;
position: fixed;
bottom: 0;
display:block;
}
.email {
display:block;
}
.facebook {
display:block;
}
.google {
display:block;
}
.pinterest {
display:block;
}
.twitter {
display:block;
}
}
</style>
</head>
<script>
function OnStart()
{
console.log( 'application started' );
}
function Email()
{
var url = "mailto:?Subject=Simple Share Buttons&Body=I%20saw%20this%20and%20thought%20of%20you!%20 https://simplesharebuttons.com";
app.OpenUrl( url );
}
function Facebook()
{
var url = "http://www.facebook.com/sharer.php?u=https://simplesharebuttons.com";
app.OpenUrl( url );
}
function Google()
{
var url = "https://plus.google.com/share?url=https://simplesharebuttons.com";
app.OpenUrl( url );
}
function Twitter()
{
var url = "https://twitter.com/intent/tweet?url=https%3A%2F%2Fsimplesharebuttons.com&text=Simple%20Share%20Buttons&hashtags=simplesharebuttons";
app.OpenUrl( url );
}
</script>
If you look at the "Text Formatting" sample, you will see the following comment.
/*
The following basic Html formatting Tags are supported
within Text, Button and List controls. For more advanced
text formatting use a WebView control.
<a href="..."> <b>, <big>, <br>, <div>,
<font color="..." face="...">
<h1>, <h2>, <h3>, <h4>, <h5>, <h6>
<i>, <img src="...">, <p>, <small>
<strong>, <sub>, <sup>, <tt>, <u>
*/