对于之前解释它的混乱感到抱歉,让我再试一次....
所以这里是我上传图片时生成的基本代码(忽略img标签,它们被镜像以节省空间)。
上传的图片不会立即显示,而是显示的消息显示“您的图片很快就可以查看”。我想创建一个AJAX刷新来查找该文本,如果找到它,刷新整个部分的父div:
<div class="section-content imgupload marginb clearfix">
这是完整的代码
<div class="section-content imgupload marginb clearfix">
<div class="ngg-galleryoverview" id="ngg-gallery-1-5">
<div id="ngg-image-12" class="ngg-gallery-thumbnail-box">
<div class="ngg-gallery-thumbnail">
<img/>
</div>
</div>
<div id="ngg-image-11" class="ngg-gallery-thumbnail-box">
<div class="ngg-gallery-thumbnail">
<img/>
</div>
</div>
<div id="ngg-image-10" class="ngg-gallery-thumbnail-box">
<div class="ngg-gallery-thumbnail">
<img/>
</div>
</div>
<div id="ngg-image-9" class="ngg-gallery-thumbnail-box">
<div class="ngg-gallery-thumbnail">
<img/>
</div>
</div>
</div>
<div class="upload_error">Your image will be available for viewing shortly</div><div id="uploadimage">
<form name="uploadimage" id="uploadimage_form" method="POST" enctype="multipart/form-data" accept-charset="utf-8"><input type="hidden" id="_wpnonce" name="_wpnonce" value="08727354a5"><input type="hidden" name="_wp_http_referer" value="/tsmgaming2012/">
<div class="uploader">
<input type="file" name="imagefiles" id="imagefiles">
</div>
<input type="hidden" name="galleryselect" value="1">
<div class="submit"><br>
<input class="button-primary" type="submit" name="uploadimage" id="uploadimage_btn" value="Upload Screenshot">
</div>
</form>
</div>