Table of Contents
回复内容:
Home Backend Development PHP Tutorial javascript - QQ分享的网页如何显示旁边缩略图呀

javascript - QQ分享的网页如何显示旁边缩略图呀

Jun 06, 2016 pm 08:14 PM
javascript php

javascript - QQ分享的网页如何显示旁边缩略图呀

像微信是默认

标签后面的第一个img
QQ里打开分享到QQ空间,网页HTML要怎么写才能显示这个图片呢

我是用手机QQ直接打开网页链接,然后点击右上角分享。
微信可以很方便分享出去,自动捕获第一张Img的图,QQ空间就不行了。

___补充

发现一件有趣的事情,通过
坑人的手机QQ打开网页URL分享到空间,不能自动捕获图片!
通过微信打开网页URL转发到 QQ空间,完全OK的!

当然,前提是你的网页HTML文件中默认捕获第一个IMG标签
网页中

紧接着加一个

javascript - QQ分享的网页如何显示旁边缩略图呀

图片宽高大于400px,最好是一个正方形的图片

作者:张煊
链接:https://www.zhihu.com/question/21668601/answer/77707210
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

坑人的手机QQ呀,靠 干脆从微信发出分享更好~

回复内容:

javascript - QQ分享的网页如何显示旁边缩略图呀

像微信是默认

标签后面的第一个img
QQ里打开分享到QQ空间,网页HTML要怎么写才能显示这个图片呢

我是用手机QQ直接打开网页链接,然后点击右上角分享。
微信可以很方便分享出去,自动捕获第一张Img的图,QQ空间就不行了。

___补充

发现一件有趣的事情,通过
坑人的手机QQ打开网页URL分享到空间,不能自动捕获图片!
通过微信打开网页URL转发到 QQ空间,完全OK的!

当然,前提是你的网页HTML文件中默认捕获第一个IMG标签
网页中

紧接着加一个

javascript - QQ分享的网页如何显示旁边缩略图呀

图片宽高大于400px,最好是一个正方形的图片

作者:张煊
链接:https://www.zhihu.com/question/21668601/answer/77707210
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

坑人的手机QQ呀,靠 干脆从微信发出分享更好~

手机QQ也有相应的JS SDK:

http://open.mobile.qq.com/api/component/share

第一种方法:用了Meta Property=og标签,就是你同意了网页内容可以被其他社会化网站引用等,目前这种协议被SNS网站如Fackbook、renren采用。
SNS已经成为网络上的一大热门应用,优质的内容通过分享在好友间迅速传播。为了提高站外内容的传播效率,2010年F8会议上Facebook公布 了一套开放内容协议(Open Graph Protocol),任何网页只要遵守该协议,SNS就能从页面上提取最有效的信息并呈现给用户。

<code><meta property="og:site_name" content="Funny hours">
<meta property="og:description" content="百度一下">
<meta property="og:image" content="https://www.baidu.com/img/bd_logo1.png">
<meta property="og:title" content="百度一下就能骗你">
<meta property="og:url" content="https://www.baidu.com/"></code>
Copy after login

第二种方法:网页中有图片即可获取到
第三种方法:`获取“分享到QQ”按钮点击状态及自定义分享内容接口

<code>wx.onMenuShareQQ({
    title: '', // 分享标题
    desc: '', // 分享描述
    link: '', // 分享链接
    imgUrl: '', // 分享图标
    success: function () { 
       // 用户确认分享后执行的回调函数
    },
    cancel: function () { 
       // 用户取消分享后执行的回调函数
    }
});</code>
Copy after login

对了加一个获取“分享到QQ空间”按钮点击状态及自定义分享内容接口

<code>wx.onMenuShareQZone({
    title: '', // 分享标题
    desc: '', // 分享描述
    link: '', // 分享链接
    imgUrl: '', // 分享图标
    success: function () { 
       // 用户确认分享后执行的回调函数
    },
    cancel: function () { 
        // 用户取消分享后执行的回调函数
    }
});</code>
Copy after login

JS-SDK说明文档

http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html#.E8.8E.B7.E5.8F.96.E2.80.9C.E5.88.86.E4.BA.AB.E5.88.B0QQ.E2.80.9D.E6.8C.89.E9.92.AE.E7.82.B9.E5.87.BB.E7.8A.B6.E6.80.81.E5.8F.8A.E8.87.AA.E5.AE.9A.E4.B9.89.E5.88.86.E4.BA.AB.E5.86.85.E5.AE.B9.E6.8E.A5.E5.8F.A3

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

CakePHP Working with Database CakePHP Working with Database Sep 10, 2024 pm 05:25 PM

Working with database in CakePHP is very easy. We will understand the CRUD (Create, Read, Update, Delete) operations in this chapter.

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

To work on file upload we are going to use the form helper. Here, is an example for file upload.

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

CakePHP Creating Validators CakePHP Creating Validators Sep 10, 2024 pm 05:26 PM

Validator can be created by adding the following two lines in the controller.

CakePHP Logging CakePHP Logging Sep 10, 2024 pm 05:26 PM

Logging in CakePHP is a very easy task. You just have to use one function. You can log errors, exceptions, user activities, action taken by users, for any background process like cronjob. Logging data in CakePHP is easy. The log() function is provide

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

See all articles