我试图运行这个简单的查询并且正在
“SyntaxError:意外的标记ILLEGAL”。
db.Bookdetail.insert({
"Subject":"Book Details",
"Details": [
{
"Book Id":"001",
"Book Name":"C# step by step",
"Book Description":"Programming book on C#"
},
{
"Book Id":"002",
"Book Name":"Head First Java",
"Book Description":"Programming Book on Java"
},
{
"Book Id":"003",
"Book Name":"Steve Jobs",
"Book Description":"biography of Jobs"
}
]
});
答案 0 :(得分:1)
似乎<?php
$flag = $_GET['flag'];
if(!isset($_GET['flag'])){
?>
<li class="active"><a data-toggle="tab" href="#menu2">All</a></li>
<li ><a data-toggle="tab" href="#home">Popular</a></li>
<li ><a data-toggle="tab" href="#menu1">New</a></li>
<?php
}
elseif($flag == 3){
?>
<li class="active"><a data-toggle="tab" href="#menu2">All</a></li>
<li ><a data-toggle="tab" href="#home">Popular</a></li>
<li ><a data-toggle="tab" href="#menu1">New</a></li>
<?php
}
else if ($flag == 2) {
?>
<li ><a data-toggle="tab" href="#menu2">All</a></li>
<li ><a data-toggle="tab" href="#home">Popular</a></li>
<li class="active"><a data-toggle="tab" href="#menu1">New</a></li>
<?php
}else {
?>
<li ><a data-toggle="tab" href="#menu2">All</a></li>
<li class="active"><a data-toggle="tab" href="#home">Popular</a></li>
<li ><a data-toggle="tab" href="#menu1">New</a></li>
<?php
}
?>
<?php
$flag = $_GET['flag'];
if($flag == 3){
?>
<div id="menu2" class="tab-pane fade in active">
<?php
}
else if(!isset($_GET['flag'])){
?>
<div id="menu2" class="tab-pane fade in active">
<?php
}else{
?>
<div id="menu2" class="tab-pane fade">
<?php
}
?>
中的:
无效。根据您的代码,"Book Id":"001"
中的:
是全角字母,这是JS的无效字符
答案 1 :(得分:0)
请使用此代码。
db.Bookdetail.insert({
"Subject":"Book Details",
"Details": [
{
"Book Id":"001",
"Book Name":"C# step by step",
"Book Description":"Programming book on C#"
},
{
"Book Id":"002",
"Book Name":"Head First Java",
"Book Description":"Programming Book on Java"
},
{
"Book Id":"003",
"Book Name":"Steve Jobs",
"Book Description":"biography of Jobs"
}
]
});
似乎你从源头复制了查询,它的字符无效。
由于