-1
我有一個頁面上的「添加」按鈕,並點擊添加按鈕,我需要使用Portlet打開另一個jsp的透明彈出窗口。這怎麼可能..?如何在JavaScript中點擊按鈕打開彈出窗口?
<script>
function createXMLHttpRequestObject() {
var xmlHttp;
try {
xmlHttp = new XMLHttpRequest();
} catch (e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHttp");
} catch (e) {
}
}
if (!xmlHttp)
alert("Error creating the XMLHttpRequest object.");
else
return xmlHttp;
}
var xmlHttp = createXMLHttpRequestObject();
function makeResourceCall(params,call){
if (xmlHttp){
try{
xmlHttp.open("POST", "<portlet:resourceURL/>", false);
// xmlHttp.onreadystatechange = handleRequestStateChange();
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", params.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(params);
if(call == "componentPopUp"){
componentDetailsDivFormation(xmlHttp);
}
if(call == "ibasePopUp"){
IbaseDetailsDivFormation(xmlHttp);
}
if(call == "scheduleDetailsPopUp"){
scheduleDetailsDivFormation(xmlHttp);
}
}catch (e){
alert("Can't connect to server:\n" + e.toString());
}
}
}
</script>
如何添加此代碼,以便當我單擊按鈕時,應該會發生透明彈出?
的Java = JavaScript的 – mishik