我正在使用SweetAlert2示例页面的确切代码:
swal({
title: 'Are you sure?',
text: "You won't be able to revert this!",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.value) {
swal(
'Deleted!',
'Your file has been deleted.',
'success'
)
}
})
Run Code Online (Sandbox Code Playgroud)
适用于Firefox和Chrome,但是Internet Explorer显示SCRIPT1002: Syntax Error并且不运行脚本... IE将此部分标记为语法错误:
}).then((result) => {
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助
我对带有 Telegram API 的内联机器人有问题...
我有代码:
$json = file_get_contents("php://input");
$dados = json_decode($json,true);
$id_query = $dados['inline_query']['id'];
$resultados_inline[] = [
'type' => 'article',
'id' => "1",
'title' => "Test",
'message_text' => "test",
];
$post[] = [
'inline_query_id' => $id_query,
'results' => serialize($resultados_inline),
];
$context_options = array(
'http' => array(
'method' => 'POST',
'header'=> "Content-type: application/x-www-form-urlencoded\r\n"
. "Content-Length: " . strlen($post) . "\r\n",
'content' => $post
)
);
file_get_contents("https://api.telegram.org/bot" . $api_telegram . "/answerInlineQuery",NULL,$context);
Run Code Online (Sandbox Code Playgroud)
但我收到:
{"ok":false,"error_code":400,"description":"BadRequest:QUERY_ID_INVALID"}
有人可以帮助我吗?
谢谢