开发者

How to refresh a facebook profile picture from ajax result

I have a div which is being used as a navigation container. On completion of an ajax request i am refreshing the conte开发者_运维知识库nts of the div using..nav n

$('#NAV').load('includes/nav.ini.php');

Within the div i have an image which is dynamically loaded from the facebook graph api.

<img src="https://graph.facebook.com/<?= $fid ?>/picture">

where $fid is the facebook user id.

The image is displayed correctly if you refresh the whole page but it will not appear if i refresh the div its contained in with the .load() method shown above.

why is this? and how can i make the page request the image again?

Many Thanks


The graph api image url performs a rapid redirect to a second url, which by default will use http rather than https. This may be causing a security error, so to eliminate that add the parameter ?return_ssl_resources=true to the request.

Note: the img tag should be closed at the end - <img ... />

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜