使用php更改jQuery移动翻转开关的值


Change value of jQuery mobile flip switch using php

有人知道如何仅使用php设置jQuery移动翻转开关的值吗?我试过下面的,但没有任何运气。任何想法都将不胜感激!

<?php 
    ifFilled = '1';
?>
<select name="flip-min" id="flip-min" data-role="slider">
    <option value="1" <?php echo $isFilled == '1' ? ' selected="selected"' : '';?>>Filled</option>
    <option value="0" <?php echo $isFilled == '0' ? ' selected="selected"' : '';?>>Un-Filled</option>
</select>

使用JavaScript:

先看看这把小提琴。

<label for="flip-a">Select slider:</label>
<select name="slider" id="flipMe" data-role="slider">
    <option value="off">Off</option>
    <option value="on">On</option>
</select> 
<?php if ($ifFilled == true): ?>
var fts = $('#flipMe');
fts.val('on');
fts.slider('refresh');
<?php endif; ?>

opps$ifFilled与此处的$isFilled lol年度假人奖不匹配!!!除此之外,代码运行良好。。。。