How do I open a new window in safari on the iPad?
target="_blank" is not work on iPad.
I've tried windows.open(), it worked but new window is blank, processing result has been displayed in the old window.
xhtml code is
Code: Select all
<p:commandButton id="OUTPUT_REPORT"
value="OUTPUT REPORT" ajax="false"
action="#{bean.outputReportAction}"
onclick="switchTarget();">
Code: Select all
function switchTarget(){
var ua = navigator.userAgent;
if(/iPhone/.test(ua) || /iPad/.test(ua)){
this.target = "_blank";
// window.open() <- only open new window
}
}
PrimeFaces 3.4
Java7
Tomcat7
Thanks in advance!