gpt4 book ai didi

javascript - "Mixed spaces and tabs error"和 "Uncaught SyntaxError: Unexpected token < (line 1)"

转载 作者:行者123 更新时间:2023-11-28 08:53:56 24 4
gpt4 key购买 nike

对于我之前的问题here ,我没有收到错误消息,所以复制粘贴了 jsbin.com 中的代码,在这里我在 jsbin output 中收到错误如 function fail(args) {
failCallback(args);
}
中的“缺少空格和制表符”还有"Uncaught SyntaxError: Unexpected token < (line 1)" 。对于这段 JavaScript 代码

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]);
};

无法纠正此错误,请帮助我...

html代码

 <!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>

最佳答案

尝试var SocialShare = {};这可能会解决您的问题

关于javascript - "Mixed spaces and tabs error"和 "Uncaught SyntaxError: Unexpected token < (line 1)",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18758625/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com