热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

将对象发送到远程javascript文件-SendObjecttoremotejavascriptfile

Soifiamsettingupayahoopipesbadgeonmysite,yahoogivesmethiscode因此,如果我在我的网站上设置雅虎管道徽章,

So if i am setting up a yahoo pipes badge on my site, yahoo gives me this code

因此,如果我在我的网站上设置雅虎管道徽章,雅虎给我这个代码


Notice its passing an object literal to the remote script. i would like to do something similar with my own scripts, how do you interact with that input?

注意它将对象文字传递给远程脚本。我想用自己的脚本做类似的事情,你如何与输入进行交互?

1 个解决方案

#1


3  

You can't actually pass variables around like that natively. What Yahoo is doing there is that in their listbadge.js file, it searches through all the tags on the page until it finds the one which included it, and then parses the innerHTML as JSON.

你实际上不能像原来那样传递变量。雅虎正在做的是在listbadge.js文件中,它搜索页面上的所有

Their source has been slightly obfuscated, but here's my best understanding of it.

他们的来源有点混淆,但这是我对它的最好理解。

var scripts = document.getElementsByTagName("SCRIPT");

for (var i = 0; i 

推荐阅读
author-avatar
书友71424043
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有