我有以下javascript通过ajax发布表单而不刷新屏幕.由于帖子需要一段时间,我想在处理过程中添加加载图像.
我看到这篇文章,但它似乎只列出.load()或.get()而不是$ .post.
<script type="text/javascript">
$(document).ready(function() {
$('#contact form').live('submit', function() {
$.post($(this).attr('action'), $(this).serialize(), function(data) {
$("#contact").replaceWith($(data));
});
return false;
});
});
</script>
Run Code Online (Sandbox Code Playgroud) 您好,我是 python 的新手,我想知道如何将计算机目录中的图像加载到 python 变量中。我在磁盘上的文件夹中有一组图像,我想循环显示这些图像。
我知道可以使用动态加载图像
$("#id").attr("src","path of the image"),
Run Code Online (Sandbox Code Playgroud)
但要在特定事件上载入特定图像,
$("id").attr("src","")
Run Code Online (Sandbox Code Playgroud)
不起作用.
使用jquery卸载映像运行时的正确方法是什么?
我无法更改图像的显示或可见性属性,我需要加载它卸载它.
我正在开发WP 8应用程序,我想加载当前在我的计算机驱动器上的图像.这是我的代码
try
{
using (FileStream fileStream = File.OpenRead("\\TiltFilter\\FilterEffects\\Assets\\AlignmentGrid.png"))
{
MemoryStream memStream = new MemoryStream();
memStream.SetLength(fileStream.Length);
fileStream.Read(memStream.GetBuffer(), 0, (int)fileStream.Length);
}
}
catch (Exception e)
{
string str = e.Message;
}
Run Code Online (Sandbox Code Playgroud)
它给了我类型的例外
System.Io.DirectoryNotFoundexception
and the message is无法找到路径'C:\ TiltFilter\FilterEffects\Assets\AlignmentGrid.png'的一部分.
有些人可以帮助我如何在WP8上加载内存流中的图像
谢谢
下拉列表更改后,我在我的mvc应用程序上发布ajax帖子.
$(function () {
$('#meters').change(function () {
var analizor_id = $(this).val();
if (analizor_id && analizor_id != '') {
$.ajax({
url: '@Url.Action("AnalizorInfoPartial", "Enerji")',
type: 'GET',
cache: false,
data: { analizor_id: analizor_id },
success: function (result) {
$('#TableAnalizorInfo').html(result);
}
});
}
});
});
Run Code Online (Sandbox Code Playgroud)
落下
@Html.DropDownList("sno", new SelectList(Model, "sno", "AnalizorAdi"), "-- Analizör Seçiniz --", new { id = "meters" })
Run Code Online (Sandbox Code Playgroud)
我可以在ajax过程中显示加载图像或其他任何内容吗?(在开始 - 结束事件之间)和代码示例?
编辑
我可以这样用吗?
success: function (result) {
$('#TableAnalizorInfo').html(result);
}
begin:function(){
//show image
}
complete:function(){
//hide image
}
Run Code Online (Sandbox Code Playgroud)
谢谢.
我已经尝试过这个解决方案,但无法使其正常工作。我对 Angular2 完全陌生(不了解 AngularJS)。好吧,加载屏幕没有显示,我想我需要添加一些超时,以便它有一些时间显示,但我不知道在哪里以及如何显示。
应用程序组件.ts
import {Component} from '@angular/core';
import {
Router,
// import as RouterEvent to avoid confusion with the DOM Event
Event as RouterEvent,
NavigationStart,
NavigationEnd,
NavigationCancel,
NavigationError
} from '@angular/router';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./loadingCSS.css']
})
export class AppComponent {
// Sets initial value to true to show loading spinner on first load
loading = true;
constructor(private router: Router) {
router.events.subscribe((event: RouterEvent) => {
this.navigationInterceptor(event);
});
}
// Shows and hides the loading …Run Code Online (Sandbox Code Playgroud)