运行以下初始化时出现错误
var data = "<div class='modal fade' id='add_image"+id+"' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'> <div class='modal-dialog'> <div class='modal-content'> <div class='modal-body'> <button type='button' id='close"+id+"' class='close' data-dismiss='modal'><span aria-hidden='true'>×</span><span class='sr-only'>Close</span></button> <ul id='tabs' class='nav nav-tabs' data-tabs='tabs'> <li class='active'><a href='#upload"+id+"' data-toggle='tab'><span class='glyphicon glyphicon-open'></span> Upload</a></li> <li><a href='#search"+id+"' data-toggle='tab'><span class='glyphicon glyphicon-search'></span> Search</a></li> </ul> <div id='my-tab-content' class='tab-content'> <div class='tab-pane active' id='upload"+id+"'> <center> <p class='lead' id='q_upload_result"+id+"'></p> <input type='file' name='ques_image"+id+"' id='ques_image"+id+"' data-imgfile=""+id+"" style='visibility:hidden;' onchange='showimagepreview(this);'> <button type='button' id='file_trigger"+id+"' data-tid='"+id+"' class='btn btn-primary'><span class='glyphicon glyphicon-folder-open' onclick='trigger_up(this);'></span> Browse</button> </center> </div> <div class='tab-pane' id='search"+id+"'> <br> <input id='q_search"+id+"' name='q"+id+"' type='text' class='form-control' placeholder='search here..'><hr> <span id='img_res"+id+"'></span> </div> </div> </div> </div> </div> </div>";
为了便于阅读:
var data = "<div class='modal fade' id='add_image"+id+
"' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'> <div class='modal-dialog'> <div class='modal-content'> <div class='modal-body'> <button type='button' id='close"+
id+"' class='close' data-dismiss='modal'><span aria-hidden='true'>×</span><span class='sr-only'>Close</span></button> <ul id='tabs' class='nav nav-tabs' data-tabs='tabs'> <li class='active'><a href='#upload"+
id+"' data-toggle='tab'><span class='glyphicon glyphicon-open'></span> Upload</a></li> <li><a href='#search"+id+"' data-toggle='tab'><span class='glyphicon glyphicon-search'></span> Search</a></li> </ul> <div id='my-tab-content' " +
" class='tab-content'> <div class='tab-pane active' id='upload"+id+"'> <center> <p class='lead' id='q_upload_result"+
id+"'></p> <input type='file' name='ques_image"+
id+"' id='ques_image"+
id+"' data-imgfile=""+
id+"" style='visibility:hidden;' onchange='showimagepreview(this);'> <button type='button' id='file_trigger"+id+"' data-tid='"+
id+"' class='btn btn-primary'><span class='glyphicon glyphicon-folder-open' onclick='trigger_up(this);'></span> Browse</button> </center> </div> <div class='tab-pane' id='search"+
id+"'> <br> <input id='q_search"+id+"' name='q"+id+"' type='text' class='form-control' placeholder='search here..'><hr> <span id='img_res"+id+"'></span> </div> </div> </div> </div> </div> </div>";
答案 0 :(得分:0)
引用错误接近..... id+"' data-imgfile=""+id+ ....