加载图像上单击具有AJAX(jQuery的) [英] Load Image On Click With AJAX (jQuery)

查看:130
本文介绍了加载图像上单击具有AJAX(jQuery的)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个移动网站,与所有在一个PHP页面的内容,和网页(或div的比较),互换使用jQuery。我想,加快装载时间和大头什么必须加载是在每个人的生物图象。我想使用jQuery只加载人物形象时,他们的生物导航到。我猜我需要使用AJAX,因为我们不能依赖于一个页面刷新。任何指针?谢谢!

I have a mobile site, with all the content on one PHP page, and the pages (or div's rather), are swapped with jQuery. I want to speed up the load time, and the bulk of what has to be loaded are images on each persons bio. I would like to use jQuery to only load the persons image when their bio is navigated to. I'm guessing I need to use AJAX because we can't rely on a page refresh. Any pointers? Thanks!

推荐答案

您可以使用jQuery的负载加载图像的DOM完成后装入

you can use the jquery load to load the image after the dom is completed to load

$(function(){
   $("#imgUser").load("images/testimg.jpg");  
});

这篇关于加载图像上单击具有AJAX(jQuery的)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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