javascript-意外标记?
我想在上传照片时添加加载gif。 以下是我的JavaScript:javascript-意外标记?,javascript,html,css,Javascript,Html,Css,我想在上传照片时添加加载gif。 以下是我的JavaScript: <script type="text/javascript"> function call(tab) { $(".loading").html("<center><br><br><img src=\"icons/processing.gif\" /><br><br></center>").load(tab);
<script type="text/javascript">
function call(tab) {
$(".loading").html("<center><br><br><img src=\"icons/processing.gif\" /><br><br></center>").load(tab);
}
</script>
函数调用(选项卡){
$(“.loading”).html(“
”).load(选项卡);
}
这就是我调用函数的方式:
<div class="loading"></div>
<div class="col-md-12">
<div class="form-group">
<input type="file" name="take_photo" id="take_photo" class="take-photo" onchange="submit(); call('survey_edit.php?id='<?$id;?>'&step=photo')">
<label for="take_photo"><figure><img src="icons/camera.png"></figure> <span><?=v("take_photo");?>…</span></label>
</div>
<div class="form-group">
<?=$f->input("back",v("back"),"type='button' onclick=\"window.location='?step=2&id=".$id."';\"","btn btn-warning");?>
<?=$f->input("finish",v("finish"),"type='button' onclick=\"window.location='mysurvey.php';\" style='position:relative;float:right;'","btn btn-primary");?>
</div>
</div>
您的onchange事件应该如下所示:
onchange=“submit();call('survey_edit.php?id=&step=photo')”
您的onchange事件应该是这样的:
onchange=“submit();call('survey_edit.php?id=&step=photo')”
根据评论,该行存在问题:
<input type="file" name="take_photo" id="take_photo" class="take-photo" onchange="submit(); call('survey_edit.php?id='<?$id;?>'&step=photo')">
根据评论,该行存在问题:
<input type="file" name="take_photo" id="take_photo" class="take-photo" onchange="submit(); call('survey_edit.php?id='<?$id;?>'&step=photo')">
您的源代码在.form组中似乎已中断。另外,center
长期以来一直被弃用。有更好的方法可以做到这一点,而且更为流行。里面是PHP吗?可能是您的web服务器设置不正确。第二部分是php吗?如果是,则显示发送到服务器的最终html代码。但是最有可能的错误在这里?id='&step=
在@t.niese之前'
我也刚刚意识到了PHP。@t.niese谢谢你的解释错误很清楚,但是我的加载gif还没有显示出来。有什么建议吗?@payket这是一个不同的问题,因此必须以新问题的形式提出。您的源代码看起来已被打断。form group。另外,center
长期以来一直被弃用。有更好的方法可以做到这一点,而且更为流行。里面是PHP吗?可能是您的web服务器设置不正确。第二部分是php吗?如果是,则显示发送到服务器的最终html代码。但是最有可能的错误在这里?id='&step=
在@t.niese之前'
我也刚刚意识到了PHP。@t.niese谢谢你的解释错误很清楚,但是我的加载gif还没有显示出来。有什么建议吗?@payket这是一个不同的问题,因此必须作为新问题提出。