//Windows1.XML
<Alloy>
<Window exitOnClose="false">
<Button onClick="openWindows2" visible="false">
</Button>
</Window>
</Alloy>
CONTROLLER
//Window1.js
function openWindows2(e)
{
var Window2=Alloy.createController('Window2').getView();
newWindows.open();
}
$.Windows1.open()
<Alloy>
<Window exitOnClose="false">
<Button onClick="openWindows3" visible="false">
</Button>
</Window>
</Alloy>
function openWindows3(e)
{
var Window3=Alloy.createController('Window3').getView();
newWindows.open();
}
$.Windows2.open()
<Alloy>
<Window exitOnClose="false">
<Button onClick="anotherFn" visible="false">
</Button>
</Window>
</Alloy>
//Window3.js
$.Windows3.open()
最佳答案
你用 XML 定义你的窗口,比如 mycoolwindow.xml。
然后从你的代码的其他部分:
var win=Alloy.createController('mycoolwindow').getView();
win.open();
关于javascript - close window and open a new window 钛合金,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18669609/