How to open an alert from another page

How to open an alert from another page

BY 11 Jul 2014 Web Application Development

Hello,

I have the following code into my index.html file:

<body class="main">
    <div id="hider">
	<img src="set_time.png" onclick="choose();">
	</div>


  <script type="text/javascript" src="js/work.js"></script>
 

   
</body>

and This is the work.js file:

function choose(){
	window.open("timesetting.html#2btnPopup");


}

 

and the timesetting.html (which contain one of the alerts samples):

<body>
<div class="ui-page">
    <header class="ui-header">
	<h2 class="ui-title">Popup</h2>
	</header>
	<div class="ui-content content-padding">
	
		<h3>Buttons</h3>
		<div class="ui-grid-row">
			<a href="#2btnPopup" class="ui-btn" data-rel="popup">2btn popup</a>
		</div>

	</div>

	<div id="2btnPopup" class="ui-popup">
		<div class="ui-popup-header">Power saving mode</div>
		<div class="ui-popup-content">
			Turning on Power
			saving mode will
			limit the maximum
			power
		</div>
		<div class="ui-popup-footer ui-grid-col-2">
			<button id="2btnPopup-cancel" class="ui-btn">Cancel</button>
			<button id="2btnPopup-ok" class="ui-btn">OK</button>
		</div>
	</div>


	
	<div id="popupToast" class="ui-popup ui-popup-toast">
		<div class="ui-popup-content">
			Saving contacts to sim on Samsung 
		</div>
	</div>
	<script type="text/javascript" src="popup.js"></script>
</div>
</body>

 

Normally, when I click on the link into my index.html file, the ( timesetting.html ) page is opened … I want to have the alert opened once the user have clicked on the link on the inde.html (without redirecting to the timesetting.html).

 

I hope you understand me! Thanks in advance.

Written by