Languages

Menu
Sites
Language
How to open an alert from another page

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.

Edited by: karray gargouri on 11 Jul, 2014

Responses

3 Replies
Alex Dem

Hi,
If you are working on Tizen UI framework or on jquery-mobile based project (Tizen UI framework based on jquery-mobile fyi) you could use popups and place them inside your page:

<div data-role="page">
...
 <div class="content" data-role="content">
...
  <div id="myPopup" data-role="popup" class="popupClass"> </div>
  </div>
...
</div>


and use

<a href="#myPopup" data-rel="popup">Open Popup</a>
$( "#myPopup" ).popup( "open" )
$( "#myPopup" ).popup( "close" )

for opening/closing.
see Tizen Web Example->Tizen Winset->Popup also.
Alexey.

Alex Dem

fyi, you could try to load in 'dialog' widget also (it is still able in jquerymobile)
<a href="timesetting.html" data-rel="dialog">Open dialog</a>
but in this case you will load your separate html file.
Alexey

Alex Dem

If you are working with 'wearable' devices - my recomendations are wrong. I have checked with Tizen mobiles, but it was not clear from topic for me.
Alexey.