深圳市网站开发,个人养老保险金怎么交,商城网站有什么好处,钛媒体 wordpress为了防止无良网站的爬虫抓取文章#xff0c;特此标识#xff0c;转载请注明文章出处。LaplaceDemon/SJQ。 http://www.cnblogs.com/shijiaqi1066/p/5560843.html 以前利用webqq的写过一个自动发消息的脚本#xff0c;由于那时webqq还直接使用类似jQuery操作DOM的技术#x… 为了防止无良网站的爬虫抓取文章特此标识转载请注明文章出处。LaplaceDemon/SJQ。 http://www.cnblogs.com/shijiaqi1066/p/5560843.html 以前利用webqq的写过一个自动发消息的脚本由于那时webqq还直接使用类似jQuery操作DOM的技术所以脚本很简单就可以实现。 现如今很多web应用都开始使用AngularJSMVVM导致的就是无法操作dom而去直接改变数据。所以面对网页版微信要实现一个自动发送的脚本就无法再用以前那套DOM的思路了。 要修改AngularJS中的数据首先就要获取scope。其实获取scope的方法很简单。 由于大部分Angular项目需要使用jQuery作为补充。可以在jQuery中通过.scope()方法获取当前选择器内容里继承的域。 即类似这样的方式 $(div[ng-controllerlistController]).scope(); 例完整的例子。 !DOCTYPE html
html langen ng-appapp
headmeta charsetUTF-8titleGet angulars scope in jQuery/titlescript srchttp://cdn.bootcss.com/jquery/2.1.4/jquery.js/scriptscript srchttp://cdn.bootcss.com/angular.js/1.4.3/angular.js/scriptscriptangular.module(app,[]).controller(listController,[$scope, function ($scope) {$scope.list [1,2,3,4,5];$scope.test function () {console.log(test);}}])/scriptscript$(document).on(ready, function () {var controllerScope $(div[ng-controllerlistController]).scope(); // Get controllers scopecontrollerScope.test(); // log testconsole.log(controllerScope.list); // log [1,2,3,4,5]$(button).click(function (e) {var scope $(e.target).scope();console.log(scope.item) // log item numberscope.test(); // log test})})/script
/head
body
div ng-controllerlistControllerulli ng-repeatitem in listbuttonSelect {{item}}/button/li/ul
/div
/body
/html 那么打开网页版微信的页面(2016-06-05)选中你需要发消息的人。然后执行如下脚本 var controllerScope $(div[ng-controllerchatSenderController]).scope(); // 获取chatSenderController的$scope
controllerScope.editAreaCtn 星哥,下午好; // 设置需要发送的消息。即设置$scope某个属性的值。// 触发“发送按钮”的点击事件。
$(.action a).trigger(click); 非常好的“外挂方式”。 为了防止无良网站的爬虫抓取文章特此标识转载请注明文章出处。LaplaceDemon/SJQ。 http://www.cnblogs.com/shijiaqi1066/p/5560843.html 转载于:https://www.cnblogs.com/shijiaqi1066/p/5560843.html