zoukankan      html  css  js  c++  java
  • 动态载入script,js跨站点访问数据

    1.可以通过动态加载script标签来跨域载入变量。
    跨域直接用ajax方式无法载入,但可以用scrit标签载入。
    使用时可能有一些问题(没试成功),但可以先把值放到dom中传一下。

    2.script标签有addEventListener onload事件,这上面处理变量载入成功以后事。

    3.tor有时访问页面,需要加一个随机数强制刷新(未详测)

    4.tor的ip更换很缓慢且不定,有时几十秒,有时几十分钟都没有更新ip。

    5.tor主页显示的ip变得很快,实际上没有变。未知原因。

    //动态载入Script标签(处理内存泄漏问题)
    function OnScriptLoaded()
    {
        
    var status = document.title;
    }

    function LoadScript()
    {
        
    var script=document.getElementById('ScriptId');
        
    if (script)
        {
            document.getElementsByTagName(
    "head")[0].removeChild(script);
            script 
    = null;
        }

        script
    =document.createElement("script");
        script.type
    ="text/javascript";
        script.id
    ="ScriptId";
        script.addEventListener(
    "load", OnScriptLoaded, false);
        script.src
    ="http://www.guoguoer.cn/abcd.php?p=u&rnd=" + Math.random();
        document.getElementsByTagName(
    "head")[0].appendChild(script);
    }
  • 相关阅读:
    ORA-00119: invalid specification for system parameter LOCAL_LISTENER
    local_listener参数的作用!
    DDL为什么不能rollback?
    LGWR和DBWn的触发条件
    修改spfile位置
    初识oracle重做日志文件
    ORACLE AUDIT 审计
    Oracle SQL_TRACE使用小结
    Web API(六):使用Autofac实现依赖注入
    JavaScript:属性的操作
  • 原文地址:https://www.cnblogs.com/nonlyli/p/1581085.html
Copyright © 2011-2022 走看看