Experimental codes to find out what order the events fired in jQuery Mobile 1.2.0.
For more information, please refer this article:
jQuery Mobileのページ遷移時にイベントが発火する順番 | 1000g (Japanese only)
<?php | |
if (isset($_POST['input']) && isset($_POST['mode'])) { | |
ob_start(); | |
// Needs decoding because $_POST is encoded when jQuery.ajax sended the data. | |
$input = urldecode($_POST['input']); | |
switch ($_POST['mode']) { | |
case 'serialize': | |
$output = serialize($input); |
<?php | |
$subjects = array( | |
null, | |
true, | |
false, | |
"false", // 文字列の false | |
"", // 空文字列 | |
0, // integer の 0 | |
"0", // string の 0 | |
"aaaaa", // 任意のstring |
<?php | |
/** | |
* Array to Text Table Generation Class | |
* | |
* @author Tony Landis <[email protected]> | |
* @link http://www.tonylandis.com/ | |
* @copyright Copyright (C) 2006-2009 Tony Landis | |
* @license http://www.opensource.org/licenses/bsd-license.php | |
*/ | |
class ArrayToTextTable |
<?php | |
// Frequently-appearing phrases which relate to paths. | |
$paths = array( | |
array('__FILE__', __FILE__), | |
array('realpath(__FILE__)', realpath(__FILE__)), | |
array('dirname(__FILE__)', dirname(__FILE__)), | |
array('basename(__FILE__)', basename(__FILE__)), | |
array('pathinfo(__FILE__)', pathinfo(__FILE__)), | |
array('__DIR__', __DIR__), | |
); |
Experimental codes to find out what order the events fired in jQuery Mobile 1.2.0.
For more information, please refer this article:
jQuery Mobileのページ遷移時にイベントが発火する順番 | 1000g (Japanese only)
This code is for the problem of jQuery Mobile using Google Maps API.
When there are the window placed Google Maps (gmap1.html) and Form (gmap2.html), the Map is not rendered after the following transition:
To fix it, use $.mobile.ajaxEnabled = false; option.
The way to inject list view into the page with jQuery Mobile 1.2.0.
Official tutorial is a little bit complex, so that I wrote this gist.
For more details, refer the following article:
jQuery Mobileでリストビューを動的に挿入する方法 | 1000g. (Japanese only)
<!DOCTYPE HTML> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>page 1</title> | |
<link rel="stylesheet" type="text/css" href="http://code.jquery.com/mobile/latest/jquery.mobile.min.css" /> | |
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script> | |
<script type="text/javascript" src="http://code.jquery.com/mobile/latest/jquery.mobile.min.js"></script> | |
<style type="text/css" media="screen"> |
<?php | |
App::uses('AppController', 'Controller'); | |
class ApisController extends AppController { | |
// どの Model も使わないようにする。 | |
public $uses = false; | |
public function index() { | |
$data = array(); |
/** | |
* 画像の実際のサイズを取得する | |
* | |
* @param string image img要素 | |
*/ | |
function getActualDimension(image) { | |
var run, mem, w, h, key = "actual"; | |
// for Firefox, Safari, Google Chrome | |
if ("naturalWidth" in image) { | |
return {width: image.naturalWidth, height: image.naturalHeight}; |