zoukankan      html  css  js  c++  java
  • 如何给frame标签的src属性以及a标签的href属性自动设值

    <frame src="" id="main" name="main" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" target="main"   />

    <a class="location_a" id="bas" href="" onclick="test()" target="main">基本信息</a>
    var eids = id.split("=");
    var eid = eids[1];
    $(document).ready(function(){
    	$("#main").attr("src", "/aaa/bbb.html?params="+eid);
    });

      jquery通过frame的id进行赋值

     	var exhid = top.id;//获取上一个页面(index.html)的数据,id为上一个页面js里面的值
    	var exh = exhid.split("=");
    	var eid = exh[1];//获取从前台传过来的id
    	function test(){
    		$("#bas").attr("href","/aaa/bbb.html?params="+eid);
    	}
    

      jquery通过a标签的id进行赋值

      params为URL所需要传递的参数

      使用之前需要引入jQuery文件

  • 相关阅读:
    linux之参数实用讲解
    Linux脚本中调用SQL,RMAN脚本
    shell for参数
    Linux Shell参数替换
    Python OOP(1)
    Python 不可变对象
    Python set
    Python tuple
    Python list,tuple,dict and set
    Python 可变长度函数参数
  • 原文地址:https://www.cnblogs.com/heyuxiu/p/6117682.html
Copyright © 2011-2022 走看看