博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
页面分享到微博、qq、qqzone
阅读量:7198 次
发布时间:2019-06-29

本文共 1160 字,大约阅读时间需要 3 分钟。

  hot3.png

前几天做一个页面分享的功能,平常我们都是做微信分享的,提供了jssdk,但是这次是在默认的浏览器上分享到微博,在iPhone手机上浏览器可以直接分享到微信或微博平台。

但是这次我们要自己用平台提供的jscallback来做,下面贴出几个这几个链接

微博

let params = `title=${encodeURIComponent(title)}&url=${encodeURIComponent(url)}&content=utf8&sourceUrl=${url}&pic=${picurl}`let sharesinastring =`https://v.t.sina.com.cn/share/share.php?${params}`window.open(shareqqzonestring, 'newwindow', 'width=300,height=400,left=100')

qqzone

let params = `title=${encodeURIComponent(title)}&summary=${encodeURIComponent(title)}&url=${encodeURIComponent(url)}&pics=${picurl}`let shareqqzonestring = `https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?${params}`window.open(shareqqzonestring,'newwindow','width=300,height=400,left=100')

qq

let parmas = `title=${encodeURIComponent(title)}&url=${encodeURIComponent(url)}&source=${url}&desc=${encodeURIComponent(title)}&pics=${picurl}&summary=${desc}`let shareqq =`https://connect.qq.com/widget/shareqq/index.html?${params}`window.open(shareqq,'newwindow','width=300,height=400,left=100')

以上是分享 内容,在某些手机浏览器可能有兼容性问题,比如登录失败遇到过几次,但过几天又好了,至今没得出什么规律,需要注意的是在分享的url尽量不要带参数,如果带参数加encodeURIComponet也可以解决,

转载于:https://my.oschina.net/idip/blog/2253262

你可能感兴趣的文章
《自己动手做交互系统》——1.1 项目简介和背景知识
查看>>
hibernate-validator实现入参校验(包含get与post)
查看>>
利用随机数随机生成指定位数的字符串
查看>>
android 股票K线图
查看>>
《C语言及程序设计》实践项目——初练结构体
查看>>
数据结构之数组
查看>>
JS AES加密与PHP解密
查看>>
Spark修炼之道(高级篇)——Spark源码阅读:第一节 Spark应用程序提交流程
查看>>
图形化界面 远程 linux
查看>>
ECMAScript 6 入门简介
查看>>
mina 2 心跳包
查看>>
Heap Dump与Analyzer
查看>>
PostgreSQL基于流复制的HA实现
查看>>
Gitlab从删库到恢复 - 数据库备份\恢复\容灾\HA的靠谱姿势
查看>>
OC:打僵尸问题(类的问题)
查看>>
MQTT协议学习笔记
查看>>
Linux进阶01:tmux
查看>>
mysql5.7免安装版,安装启动
查看>>
centos 6.5 搭建php
查看>>
禁用E40触摸板缩短开机时间
查看>>