zoukankan      html  css  js  c++  java
  • js 文件引用传递参数

    每天学习一点点 编程PDF电子书免费下载: http://www.shitanlife.com/code

    (function() {
    var hm = document.createElement("script");
    hm.setAttribute("src", "/manager/js/sta-tw.js");
    hm.setAttribute("id", "staScript");
    hm.setAttribute("appid", appId);
    hm.setAttribute("userid", userId);
    var s = document.getElementsByTagName("script")[0]; 
    s.parentNode.insertBefore(hm, s);
    })();
    </script>

    <!-- <script id="staScript" type="text/javascript" src="/manager/js/sta-tw.js" userid="" appid="3"></script> -->

    ==============================================================================================


    var appId = document.getElementById('staScript').getAttribute('appid');
    var userId = document.getElementById('staScript').getAttribute('userid');

    alert(appId)

    每天学习一点点 编程PDF电子书免费下载: http://www.shitanlife.com/code

  • 相关阅读:
    ajax 前台返回后台传递过来的数组
    js中push的用法
    split 的用法
    ckeditor上传图片
    FTP安装配置
    批量删除.svn文件
    Ext flex属性
    Extjs3 主题样式
    Ext.apply与Ext.applyIf
    SharePoint2010 Office Web Apps
  • 原文地址:https://www.cnblogs.com/scode2/p/8664197.html
Copyright © 2011-2022 走看看