在IntraWeb中内部打开新窗口的问题?加200分。(200分)

  • 主题发起人 主题发起人 net_leaf
  • 开始时间 开始时间
N

net_leaf

Unregistered / Unconfirmed
GUEST, unregistred user!
各位大侠!请教在IntraWeb中内部如何打开新窗口?例如用 IWLINK 控件如何打开新的IE窗口。回答对者加200分。
 
请用
AddToInitProc('NewWindow(''' + FileName + ''', ''MyWindow'', '''');');
 
在AppMode下打开一个新窗口是比较简单的,在Demo程序中有示例,即:

AddToInitProc('NewWindow("' + WebApplication.URLBase + '/Files/' + 'test.html' + '", "","resizeable=yes,toolbar=yes");');

最后一个参数供您对新打开的窗口进行某属性的设置。

这里打开的文件只能是网页文件或者是PDF文件,显示一些处理结果和信息给客户,是无法打AppForm的。

如果想在一个无状态条、无菜单栏的Browser窗口中运行你自己的WebApplication(也许这样看起来更专业一些),可以借用下面这段JavaScript代码:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var curPopupWindow = null;
function openNewWindow() {
var center = true
var xposition = 0; // Postions the window vertically in px
var yposition = 0; // Postions the window horizontally in px
if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
xposition = 0;
yposition = 0;
}
var width = 800
var winName = 'Test'
var height = 600
//在这里您需要设置您的服务器地址和端口号
var url = 'http://127.0.0.1:1234/'
// Features to specify for a new window
//在这里您还可以设置您要打开窗口的某些属性
args = "width=" + width + ","
+ "height=" + height + ","
+ "location=0,"
+ "menubar=0,"
+ "resizable=1,"
+ "scrollbars=0,"
+ "status=0,"
+ "titlebar=0,"
+ "toolbar=0,"
+ "hotkeys=0,"
+ "screenx=" + xposition + "," //NN Only
+ "screeny=" + yposition + "," //NN Only
+ "left=" + xposition + "," //IE Only
+ "top=" + yposition; //IE Only
// Performs the opening of the window.
if (curPopupWindow != null) {
if (!curPopupWindow.closed) {
curPopupWindow.close();
}
curPopupWindow = null;
}
curPopupWindow = window.open(url, winName, args, false);
curPopupWindow.focus();
}
// -->
</script>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var useragent = navigator.userAgent;
var bName = (useragent.indexOf('Opera') > -1) ? 'Opera' : navigator.appName;
var pos = useragent.indexOf('MSIE');
if (pos > -1) {
bVer = useragent.substring(pos + 5);
var pos = bVer.indexOf(';');
var bVer = bVer.substring(0,pos);
}
var pos = useragent.indexOf('Opera');
if (pos > -1) {
bVer = useragent.substring(pos + 6);
var pos = bVer.indexOf(' ');
var bVer = bVer.substring(0, pos);
}
if (bName == "Netscape") {
var bVer = useragent.substring(8);
var pos = bVer.indexOf(' ');
var bVer = bVer.substring(0, pos);
}
if (bName == "Netscape" && parseInt(navigator.appVersion) >= 5) {
var pos = useragent.lastIndexOf('/');
var bVer = useragent.substring(pos + 1);
}
document.writeln('You are using <br>');
document.writeln('Browser Name: ' + bName + '<br>');
document.writeln('Browser Version: ' + bVer + '<br>');
if (bVer >= 5) {
document.writeln('<br><br><b>CLICK <a href="javascript:openNewWindow()">HERE </a> TO LOG IN</b>');
}
else {
document.writeln('This section requires a fully HTML 4.0 compatible browser with javascript enabled.<br><br>');
document.writeln('Free browsers that meet HTML4 specifications are downloadable at:<br><br>');
document.writeln('<a href="http://www.microsoft.com">Microsoft (version 5 or higher)</a><br>');
document.writeln('<a href="http://www.netscape.com">Netscape (version 6 or higher)</a><br>');
document.writeln('<a href="http://www.opera.com">Opera (version 6 or higher)</a><br>');
}
// End -->
</script>

将这个HTML文件放入到您的WWW目录中,然后在服务器端安装好您的IntraWeb服务程序,那么当访问您的站点时,将引导使用者进入到一个无状态条、无菜单栏的浏览器窗口中。
 
后退
顶部