```
```
```
2. 母視窗按鈕 ```
//廠商視窗
$(".vendorWin").click(function(){
vendorWin('purchase.php?op=vendorWin',300,300);
});
```
3. 母視窗函數 ```
//子視窗函數
function vendorWin(imgName,imgH,imgW)
{
screenWidth = screen.width;//取得螢幕寬度
rightPosition = screenWidth - imgW - 20; // 計算視窗右上位置
mywin=window.open("","","left="+ rightPosition +",top=100,width=" + imgW + ",height=" + imgH + ",location=no");
mywin.location.href = imgName + "&sn=" + document.getElementById('vendor').value;
}
```
4. 從子視窗設定母視窗的元素(後來沒用) ```
var vendor = document.getElementById('vendor');
window.opener.document.getElementById('vendor').value = vendor.value;
window.opener.document.getElementById('vendor_title').value = vendor.options[vendor.selectedIndex].text;
//window.opener.getAjaxVendor(sn);
```
5. 子視窗函數 ```
```
6. 子視submit ```
```
7. 參考 modules/umg\_stk/purchase.php -> vendorWin($sn)、getAjaxVendor($sn)