点击添加按钮用jquery获取文本框值,传值给另一个页面

jquery使用

    <script type="text/javascript" src="http://jsjquery-1.3.1.js"></script>
    <script type="text/javascript" src="../../Js/widgetfriendlink.js"></script>

    <script type="text/javascript" language="javascript">

        function addTwo() {
            var drpCity = $("#控件id").val();
            var drpMType = $("#控件id").val();

            editWidget("xx.aspx?StatCity=" + drpCity + "&Navtype=" + drpMType + "&Act=1");
        }
    </script>

 

<input class="button" type="button" οnclick="addTwo()" value="添加"  runat="server" id="NavClassSortID"/>

 widgetfriendlink.js
function editWidget(targeturl) {
    //window.scrollTo(0, 0);
    var width = document.documentElement.clientWidth + document.documentElement.scrollLeft;
    var height = document.documentElement.clientHeight + document.documentElement.scrollTop;

    var layer = document.createElement('div');
    layer.style.zIndex = 2;
    layer.id = 'layer';
    layer.style.position = 'absolute';
    layer.style.top = '0px';
    layer.style.left = '0px';
    layer.style.height = document.documentElement.scrollHeight + 'px';
    layer.style.width = width + 'px';
    layer.style.backgroundColor = 'black';
    layer.style.opacity = '.1';
    layer.style.filter += ("progid:DXImageTransform.Microsoft.Alpha(opacity=30)");
    document.body.style.position = 'static';
    document.body.appendChild(layer);

    var size = {
        'height': 350,
        'width': 800
    };
    var iframe = document.createElement('iframe');
    iframe.name = 'Widget Editor';
    iframe.id = 'WidgetEditor';
    iframe.src = targeturl;
    iframe.style.height = size.height + 'px';
    iframe.style.width = size.width + 'px';
    iframe.style.position = 'absolute';
    iframe.style.zIndex = 3;
    iframe.style.backgroundColor = 'white';
    iframe.style.border = '2px solid #8DB2E3';
    iframe.frameborder = '0';

    iframe.style.top = ((height + document.documentElement.scrollTop) / 2) - (size.height / 2) + 'px';
    iframe.style.left = (width / 2) - (size.width / 2) + 'px';

    document.body.appendChild(iframe);
}
function editWidget2(targeturl, w, h) {
    //window.scrollTo(0, 0);
    var width = document.documentElement.clientWidth + document.documentElement.scrollLeft;
    var height = document.documentElement.clientHeight + document.documentElement.scrollTop;

    var layer = document.createElement('div');
    layer.style.zIndex = 2;
    layer.id = 'layer';
    layer.style.position = 'absolute';
    layer.style.top = '0px';
    layer.style.left = '0px';
    layer.style.height = document.documentElement.scrollHeight + 'px';
    layer.style.width = width + 'px';
    layer.style.backgroundColor = 'black';
    layer.style.opacity = '.1';
    layer.style.filter += ("progid:DXImageTransform.Microsoft.Alpha(opacity=30)");
    document.body.style.position = 'static';
    document.body.appendChild(layer);

    var size = 
    {
        'height': 450,
        'width': 800
    };
    size.width = w;
    size.height = h;
    
    var iframe = document.createElement('iframe');
    iframe.name = 'Widget Editor';
    iframe.id = 'WidgetEditor';
    iframe.src = targeturl;
    iframe.style.height = size.height + 'px';
    iframe.style.width = size.width + 'px';
    iframe.style.position = 'absolute';
    iframe.style.zIndex = 3;
    iframe.style.backgroundColor = 'white';
    iframe.style.border = '2px solid #8DB2E3';
    iframe.frameborder = '0';

    iframe.style.top = ((height + document.documentElement.scrollTop) / 2) - (size.height / 2) + 'px';
    iframe.style.left = (width / 2) - (size.width / 2) + 'px';

    document.body.appendChild(iframe);
}

function editWidgetHotTree(targeturl) {
    //window.scrollTo(0, 0);
    var layer = document.createElement('div');
    layer.style.zIndex = 2;
    layer.id = 'layer';
    layer.style.position = 'absolute';
    layer.style.top = '0px';
    layer.style.left = '0px';
    layer.style.height = '450px';
    layer.style.width = '1200px';
    layer.style.backgroundColor = 'black';
    layer.style.opacity = '.1';
    layer.style.filter += ("progid:DXImageTransform.Microsoft.Alpha(opacity=30)");
    document.body.style.position = 'static';
    document.body.appendChild(layer);


    var iframe = document.createElement('iframe');
    iframe.name = 'Widget Editor';
    iframe.id = 'WidgetEditor';
    iframe.src = targeturl;
    iframe.style.height = '350px';
    iframe.style.width = '600px';
    iframe.style.position = 'absolute';
    iframe.style.zIndex = 3;
    iframe.style.backgroundColor = 'white';
    iframe.style.border = '2px solid #8DB2E3';
    iframe.frameborder = '0';

    iframe.style.top = '10px';
    iframe.style.left = '280px';

    document.body.appendChild(iframe);
}


function editWidgetManagerHotel(targeturl) {
    //window.scrollTo(0, 0);
    var width = document.documentElement.clientWidth + document.documentElement.scrollLeft;
    var height = document.documentElement.clientHeight + document.documentElement.scrollTop;

    var layer = document.createElement('div');
    layer.style.zIndex = 2;
    layer.id = 'layer';
    layer.style.position = 'absolute';
    layer.style.top = '0px';
    layer.style.left = '0px';
    layer.style.height = document.documentElement.scrollHeight + 'px';
    layer.style.width = width + 'px';
    layer.style.backgroundColor = 'black';
    layer.style.opacity = '.3';
    layer.style.filter += ("progid:DXImageTransform.Microsoft.Alpha(opacity=30)");
    document.body.style.position = 'static';
    document.body.appendChild(layer);

    var size = {
        'height': 450,
        'width': 800
    };
    var iframe = document.createElement('iframe');
    iframe.name = 'Widget Editor';
    iframe.id = 'WidgetEditor';
    iframe.src = targeturl;
    iframe.style.height = size.height + 'px';
    iframe.style.width = size.width + 'px';
    iframe.style.position = 'absolute';
    iframe.style.zIndex = 3;
    iframe.style.backgroundColor = 'white';
    iframe.style.border = '4px solid silver';
    iframe.frameborder = '0';

    iframe.style.top = ((height + document.documentElement.scrollTop) / 2) - (size.height / 2) + 'px';
    iframe.style.left = (width / 2) - (size.width / 2) + 'px';

    document.body.appendChild(iframe);
}

function editWidgetManagerOrder(targeturl, w, h) {
    //window.scrollTo(0, 0);
    var width = document.documentElement.clientWidth + document.documentElement.scrollLeft;
    var height = document.documentElement.clientHeight + document.documentElement.scrollTop;

    var layer = document.createElement('div');
    layer.style.zIndex = 2;
    layer.id = 'layer';
    layer.style.position = 'absolute';
    layer.style.top = '0px';
    layer.style.left = '0px';
    layer.style.height = document.documentElement.scrollHeight + 'px';
    layer.style.width = width + 'px';
    layer.style.backgroundColor = 'black';
    layer.style.opacity = '.3';
    layer.style.filter += ("progid:DXImageTransform.Microsoft.Alpha(opacity=30)");
    document.body.style.position = 'static';
    document.body.appendChild(layer);

    var size = {
        'height': h,
        'width': w
    };
    var iframe = document.createElement('iframe');
    iframe.name = 'Widget Editor';
    iframe.id = 'WidgetEditor';
    iframe.src = targeturl;
    iframe.style.height = size.height + 'px';
    iframe.style.width = size.width + 'px';
    iframe.style.position = 'absolute';
    iframe.style.zIndex = 3;
    iframe.style.backgroundColor = 'white';
    iframe.style.border = '4px solid silver';
    iframe.frameborder = '0';

    iframe.style.top = ((height + document.documentElement.scrollTop) / 2) - (size.height / 2) + 'px';
    iframe.style.left = (width / 2) - (size.width / 2) + 'px';

    document.body.appendChild(iframe);
}

function closeEditor() {
    var we = document.getElementById("WidgetEditor");
    var la = document.getElementById("layer");
    document.body.removeChild(we);
    document.body.removeChild(la);
    document.body.style.position = '';
}

function closeEditorRoleTree() {
    $("#WidgetEditor").remove();
    $("#layer").remove();
    document.body.style.position = '';
    refreshTree();
}

function closeEditorRoleTreeNoRefreshTree() {
    $("#WidgetEditor").remove();
    $("#layer").remove();
    document.body.style.position = '';
}

function closeEditorPower(id) {
    //  var we=$("#WidgetEditor");var la=$("#layer");
    //  document.body.removeChild(we);
    //  document.body.removeChild(la);
    $("#WidgetEditor").remove();
    $("#layer").remove();
    document.body.style.position = '';
    var theid = '#' + id;
    var thesrc = $(theid).attr("src");
    $("#" + id + "").attr("src", "");
    $("#" + id + "").attr("src", thesrc);
}

function editWidgetAdmin(targeturl) {
    //window.scrollTo(0, 0);
    var width = document.documentElement.clientWidth + document.documentElement.scrollLeft;
    var height = document.documentElement.clientHeight + document.documentElement.scrollTop;

    var layer = document.createElement('div');
    layer.style.zIndex = 2;
    layer.id = 'layer';
    layer.style.position = 'absolute';
    layer.style.top = '0px';
    layer.style.left = '0px';
    layer.style.height = document.documentElement.scrollHeight + 'px';
    layer.style.width = width + 'px';
    layer.style.backgroundColor = 'black';
    layer.style.opacity = '.3';
    layer.style.filter += ("progid:DXImageTransform.Microsoft.Alpha(opacity=30)");
    document.body.style.position = 'static';
    document.body.appendChild(layer);

    var size = {
        'height': 250,
        'width': 250
    };
    var iframe = document.createElement('iframe');
    iframe.scrolling = "no";
    iframe.name = 'Widget Editor';
    iframe.id = 'WidgetEditor';
    iframe.src = targeturl;
    iframe.style.height = size.height + 'px';
    iframe.style.width = size.width + 'px';
    iframe.style.position = 'absolute';
    iframe.style.zIndex = 3;
    iframe.style.backgroundColor = 'white';
    iframe.style.border = '4px solid silver';
    iframe.frameborder = '0';

    iframe.style.top = ((height + document.documentElement.scrollTop) / 2) - (size.height / 2) + 'px';
    iframe.style.left = (width / 2) - (size.width / 2) + 'px';

    document.body.appendChild(iframe);
}

function closeEditorAdmin() {
    var we = document.getElementById("WidgetEditor");
    var la = document.getElementById("layer");
    document.body.removeChild(we);
    document.body.removeChild(la);
    document.body.style.position = '';
    checksession();
}

function closeEditorAdmin2() {
    var we = document.getElementById("WidgetEditor");
    var la = document.getElementById("layer");
    document.body.removeChild(we);
    document.body.removeChild(la);
    document.body.style.position = '';
    checknowsession();
}

function closeEditorManagerHotel(hid, rid, hname, rname, phone, fax, address) {
    var we = document.getElementById("WidgetEditor");
    var la = document.getElementById("layer");
    document.body.removeChild(we);
    document.body.removeChild(la);
    document.body.style.position = '';
    gethotelandroom(hid, rid, hname, rname, phone, fax, address);
}

function closeEditorAndReload() {
    var we = document.getElementById("WidgetEditor");
    var la = document.getElementById("layer");
    document.body.removeChild(we);
    document.body.removeChild(la);
    document.body.style.position = '';
    history.go(0);
}

function closeEditorChangeRoute(etid, rtid, rtname, tname) {
    var we = document.getElementById("WidgetEditor");
    var la = document.getElementById("layer");
    document.body.removeChild(we);
    document.body.removeChild(la);
    document.body.style.position = '';
    changeover(etid, rtid, rtname, tname);
}


 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值