在没有ajax的asp.net中加载图像 [英] Loading images in asp.net without ajax

查看:68
本文介绍了在没有ajax的asp.net中加载图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,



我想在点击没有ajax的按钮后在我的页面上加载图片。

(我已经尝试过了ajax。在ajax中加载图像发生在我希望仅在一个按钮事件上加载图像的每个事件上。

Dear All,

I want loading images on my page after clicking on button without ajax.
(i was already try with ajax. in ajax loading images occurred on every event i want loading images on only one button event).

推荐答案

这样的事情:



Something like this:

<!DOCTYPE HTML>
<html>
<head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

    <script>
        function loadImages(){
            var src = "http://s.codeproject.com/App_Themes/CodeProject/Img/logo250x135.gif";


(#bob)。attr('src',src);
}
< / script >
< / head >
< body >

< 输入 < span class =code-attribute> type = button onclick = loadImages(); value = 加载图片 > < / input >

< img id = bob > < / img >

< / body >
< / html >
("#bob").attr('src', src); } </script> </head> <body> <input type="button" onclick="loadImages();" value="Load Images"></input> <img id="bob"></img> </body> </html>


这篇关于在没有ajax的asp.net中加载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆