2013-07-04 143 views
-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>   

如何添加此代碼,以便當我單擊按鈕時,應該會發生透明彈出?

+3

的Java = JavaScript的 – mishik

回答

0
window.open("page.html","Page","menubar=no, status=no, scrollbars=no, menubar=no, width=200, height=100"); 

打開一個彈出有: 1.文件 2.窗口的名稱 3.選擇

相關問題