开发者

How to refresh a facebook profile picture from ajax result

开发者 https://www.devze.com 2023-02-10 12:00 出处:网络
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

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

精彩评论

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

关注公众号