简体   繁体   中英

How can I force a subpage in my mobile app to reload an external domain iframe and use the website cookie?

I am using a jquery mobile app development tool that makes use of the Cordova API, and it's being developed in HTML5.

I have 3 buttons in the main app page (menu) and I want each of them to open a direct link of my website inside my App (cant be direct link or it leaves app and visits with browser)

For this matter, I have created 3 subpages inside my app that load an iframe with the link I want to display from my website as follows :

<div id="dashboard" data-role="page">
  <div role="main" class="ui-content"></div>
  <iframe src="http://example.com/dashboard/" name="frame1" scrolling="yes" frameborder="no" align="center" height="100%" width="100%" style="margin-top:-40px; display:block; height:600px;"></iframe></div></div>

The problem is that once I login to my website through any of the mobile app subpages, when I visit any of them the content is never reloaded, so basically if I login in one of the subpages all the other will still ask me for the login again.

How can I force each of the subpages accessed inside my app to reload the iframe inside them every time I click the button with href to #subpage ?

如果您有权访问登录页面,则可以编辑登录页面以在加载后重定向:

<script type="text/javascript"> window.location = 'login.html'; </script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM