Giter VIP home page Giter VIP logo

Comments (4)

SimpleSimple avatar SimpleSimple commented on June 12, 2024
wx.config({
debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: "",
timestamp: "",
nonceStr: "",
signature: "",
jsApiList: [
'checkJsApi',
'onMenuShareTimeline',
'onMenuShareAppMessage',
]
});

wx.ready(function () {
wx.checkJsApi({
jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage'],
success: function (res) {
alert('res => ' + JSON.stringify(res));
},
complete: function (res) {
alert('complete res => ' + JSON.stringify(res));
},
fail: function (res) {
alert('fail res => ' + JSON.stringify(res));
},
trigger: function (res) {
alert('trigger res => ' + JSON.stringify(res));
}
});
//document.querySelector('#onMenuShareAppMessage').onclick = function () {
wx.onMenuShareAppMessage({
title: '互联网之子',
desc: '在长大的过程中,我才慢慢发现,我身边的所有事,别人跟我说的所有事,那些所谓本来如此,注定如此的事,它们其实没有非得如此,事情是可以改变的。更重要的是,有些事既然错了,那就该做出改变。',
link: '',
imgUrl: '',
trigger: function (res) {
// 不要尝试在trigger中使用ajax异步请求修改本次分享的内容,因为客户端分享操作是一个同步操作,这时候使用ajax的回包会还没有返回
alert('用户点击发送给朋友');
},
success: function (res) {
alert('已分享');
},
cancel: function (res) {
alert('已取消');
},
fail: function (res) {
alert(JSON.stringify(res));
}
});
// alert('已注册获取“发送给朋友”状态事件');
//}
});```

from ajax.

GerryIsWarrior avatar GerryIsWarrior commented on June 12, 2024

你重新用npm获取一下,因为在代码里写了Array原型的兼容方案,修改了原型,导致npm检查的时候一直报问题,现在已经去除,你再装一下最新的包试试,我本地测试已经没问题了

from ajax.

SimpleSimple avatar SimpleSimple commented on June 12, 2024

你重新用npm获取一下,因为在代码里写了Array原型的兼容方案,修改了原型,导致npm检查的时候一直报问题,现在已经去除,你再装一下最新的包试试,我本地测试已经没问题了

npm i ajax-js 获取到的是1.7版本这个对吗

from ajax.

GerryIsWarrior avatar GerryIsWarrior commented on June 12, 2024

现在npm最新的是1.0.15,npm是从1.0.X开始迭代版本号的。你不用npm,直接拉js文件,就直接到dev上拉,现在是 ajax.1.9.1.js

from ajax.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.