Javascript error tracing
<p>a member here helped me out with some code but I can't get it to work - I have tried going back to the guy who kindly supplied it but no response - if I can't get it to work soon I'll have to re-think how I do it. Everything does what it should, other than the mp3 actually playing. This is to be compiled into an iOS project using phone gap. Code below:</p>

<pre><code>$(window).load(function() {
    var selectedMP3;

    $('input[name=mp3_option]').change(function() {
        selectedMP3 = $('input[name=mp3_option]:checked').val();
    });

    $('#controlButton').click(function() {
        var $this = $(this);

        if ($this.text() === 'Zap') {
            $this.children().children().text('Stop');
        } else {
            $this.children().children().text('Zap');
            alert('Stopped playing song: ' + selectedMP3);

            $('input[name=mp3_option]').attr('checked', false).checkboxradio('refresh');
        }
    });
});​
</code></pre>

<p>HTML that plays the mp3:</p>

<pre><code>&lt;fieldset data-role="controlgroup"&gt;
                    &lt;li data-swatch="b" class="ui-li ui-li-divider ui-btn ui-bar-a ui-    corner-top" data-role="list-divider" role="" data-form="ui-bar-b"  &gt;Select a frequency&lt;/li&gt;
                    &lt;input type="radio" name="mp3_option" id="radio-choice-1" value="8000.mp3" /&gt;
                    &lt;label for="radio-choice-1"&gt;8Hz&lt;/label&gt;

                    &lt;input type="radio" name="mp3_option" id="radio-choice-2" value="16000.mp3"  /&gt;
                    &lt;label for="radio-choice-2"&gt;18Hz&lt;/label&gt;

                    &lt;input type="radio" name="mp3_option" id="radio-choice-3" value="20000.mp3"  /&gt;
                    &lt;label for="radio-choice-3"&gt;20Hz&lt;/label&gt;

                &lt;/fieldset&gt;
           &lt;div style="text-align:center"&gt;
            &lt;a href="#" data-role="button" data-inline="true" id="controlButton"&gt;Zap&lt;/a&gt;&lt;/div&gt;
</code></pre>

<p>Thanks for any help!
Jim</p>
