我的pastebin 文件中有一个变量,我想知道我是否可以让我的java 脚本使用它? Pastebin
我想也许:
<script src="http://pastebin.com/raw.php?i=j2Rm33fS"></script>
但它是一个 php 文件,出于某种原因,当我尝试显示它时,它显示为 [Object] 或什么也不显示。
我什至尝试删除变量并使它们仅在pastebin中可用,但没有一个变量显示......
最佳答案
以下代码片段对我来说效果很好。
但是,事实是 URL http://pastebin.com/raw.php?i=j2Rm33fS
的 Content-Type
是 plain/文本
。出于安全原因,某些浏览器可能会忽略它。
alert(Dump);
<script src="http://pastebin.com/raw.php?i=j2Rm33fS"></script>
关于javascript - 将 Pastebin 设置为 JavaScript 变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31267313/