您的位置:首页 > Web前端 > JQuery

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

2011-09-08 11:21 639 查看
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" onclick="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);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: