<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script> <script type="text/javascript"> $(document).delegate('#sun', 'pageshow' , function() { alert("!"); var days = ['sun','mon','tue','wed','thu','fri','fri','sat'], output = [];</script> <script src="../js/jquery.mobile-1.0.1.js"></script>
Since this code fires every pageshow event, you will receive several lists when users move to and then back to the page. Instead, you can use the pageinit event: http://jquerymobile.com/demos/1.1.0-rc.1/docs/api/events.html
Update
The error on your page comes from here:
$('ul#custom-navbar').append('<li/>', { .append('<a/>', { 'href' = "#" + days[x], 'data-ajax' = "false", 'text' = days[x] }); });
Do you see it? You have extra , { and you lack syntax to make sense. You also use equal signs, where you must use colons (as you set object properties):
$('ul#custom-navbar').append( $('<li/>').append('<a/>', { 'href' : "#" + days[x], 'data-ajax' : "false", 'text' : days[x] }) );
This creates a list item and then adds a link to it with the attributes set.
Please note that you can copy my code, paste it on top of your code (in your document), and it will work fine. I tested it using the console.
In general, you should learn how to use the console, this will help you get an amazing amount. For example, I found an error on your page after about 30 seconds ...