Mixed spaces and tabs error" and "Uncaught SyntaxError: Unexpected token <
(line 1)
for my previous question here, i did not get the error message so, copy
pasted the code in jsbin.com , here i'm getting error in jsbin output as
"Missed spaces and tabs" in function fail(args) { failCallback(args); }
and also "Uncaught SyntaxError: Unexpected token < (line 1)". for this
piece of javascript code
Esocial.js
var SocialShare = function() {};
SocialShare.email = function(param, successCallback, failCallback) {
function success(args) {
successCallback(args);
}
function fail(args) {
failCallback(args);
alert('Write Some real Text please.');
}
return PhoneGap.exec(function(args) {
success(args);
}, function(args) {
fail(args);
}, 'SocialShare', 'startEmailActivity', [param]);
};
Not able to rectify this error please help me...
html code
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-type" name="viewport"
content="initial-scale=1.0, maximum- scale=1.0, user-scalable=no,
width=device-width">
<link rel="stylesheet" href="index.css" />
<script type="text/javascript" charset="utf-8"
src="cordova-2.4.0.js"></script>
<script type="text/javascript" charset="utf-8" src="social.js"></script>
<script type="text/javascript" charset="utf-8" src="Esocial.js"></script>
<script type="text/javascript" charset="utf-8">
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
function onDeviceReady()
{
window.SocialShare = new SocialShare();
console.log("in onDeviceReady");
}
function sendEmail()
{
SocialShare.Email= function(param, successCallback, failCallback) {
window.SocialShare.email({message:'Email body', subject: "Email
Subject"},
function(msg) {
alert('Write Some real Text please.');
},
function(fail) {
}
);
}
}
</script>
</head>
<body onload="onLoad()">
<button onclick="sendEmail()" id="email">Email send </button>
</body>
</html>
No comments:
Post a Comment