Software Archive
Read-only legacy content
17060 Discussions

Remote Page Popup with window.open

Dario_C_
Beginner
654 Views

I'm writing an app with Intel XDK that conects to a remote CMS.

The local html asks the user to input some data then loads a remote page on a server using the data previusly given by the user.

After the remote page is loaded the user is shown some buttons to open images, pdf or some other infos. The buttons use window.open function to open a page that shows the content inside an iframe plus a close button that uses window.close() to close the popup and get back to the results.

If i test my app I get 2 different behaviours with the app installed on the device or the debugging session inside XDK. By using the installed compiled app I get the popup window but the close button isn't working at all, while debugging the app via usb the close button closes the app instead of the popup window.

The code that opens the popup is as follows :

onclick="window.open( 'product_pdf.aspx?code=SOMECODE','SOME_DESCRIPTIVE _TITLE','location=1,status=1,scrollbars=1,width=1200,height=800,top=,left=(screen.width/2)-(800/2),top=(screen.height/2)-(600/2)');" 

the resulting page contains an image of a close button with onClick="window.close();" and an iframe that shows the content.

Do someone knows how to solve the problem?

0 Kudos
1 Reply
PaulF_IntelCorp
Employee
654 Views

I'm not sure this will help, but I think it is worth investigating. Try using the inAppBrowser plugin, rather than an iframe. Push the (i) icon to get the full documentation for that plugin and search the web for examples (ie., search for "cordova inappbrowser plugin").

0 Kudos
Reply