What does jquerymobile do when you click a button?

Asked 2 years ago, Updated 2 years ago, 124 views

When jquerymobile pops up a dialog and the form appears and enters it,
I want to save the data and switch to the original screen.

Under the current condition, I would like to switch the screen because the screen does not switch even if I click the pop-up button.

(function(){
  $("#time1").click(ontime1);
});

function ontime1(){
	value1 = $("#t1").val();
	vartt1 = {
		t1 —te1, 
	}
	localStorage.setItem("time1", JSON.stringify(tt1));
	$.mobile.changePage("#tk11", {reverse:true});
}
<div data-role="page">
	<divid="popup" data-role="popup" data-overlay-theme="b"
		 data-disable="false" style="max-width:500px;">
		<div data-role="header" data-theme="b">
			<h1>Test</h1>
		</div>
		<div role="main" class="ui-content">
			<form>
				<fieldset>
					<p> Enter the date.</p>
					<label for="jquery-ui-dialog-form-name">Date </label>
					<input type="date" name="jquery-ui-dialog-form-name" id="t1" class="textui-wide-contentui-corner-all"value="/>
					<a href="id="time1" data-role="button" data-inline="false">Settings</a>
					</p>
				</fieldset>
			</form>
		</div>
	</div>
	<div data-role="header" id="tk11">
		<h1>jQuery Mobile TIPS</h1>
	</div>
	<div role="main" class="ui-content">
		<table id="jquery-ui-dialog-table" class="ui-widgetui-widget-content">
			<thead>
				<tr class="ui-widget-header">
					<thid="table-th-name"> Tes </th>
					<thid="table-th-comment"> Tes </th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>Tess </td>
					<td>Tess </td>
				</tr>
			</tbody>
		</table>
		<div class="jquery-ui-button">
			<a href="#popup" data-rel="popup" data-transition="pop"
			   class="ui-btnui-corner-all ui-btn-icon-left ui-icon-check">add</a>
		</div>
	</div>
	<div data-role="footer">
		<h3>Copyright</h3>
	</div>
</div>

monaca jquery-ui jquery-mobile

2022-09-30 11:04

1 Answers

Touch devices do not generate click events, so you should use tap events.


2022-09-30 11:04

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.