0
我想在新頁面出現後運行腳本。 這樣做:index.html中 (鏈接):傳遞給鏈接後運行腳本(jQuery的移動)
<a href="games.html" data-transition="slide"><img src="./images/1.jpg" alt="" width='100'/></a>
在games.html
,但是這個代碼dont'd運行:
$(document).ready(function(){
update_list_games();
});
和功能:
function update_list_games(gamer_id)
{
requestToServer(prefix_server + 'load_games_list.php?gamer_id=' + gamer_id, function(response){
if (response.data != null)
{
if (games_list == "")
{
for (i = 0; i < response.data.length; ++i)
{
games_list += "<li class='my_li' onClick=get_game("+i+")><a href='#page3'><img align='left' src='images/"+response.data[i].icon+"' height='45' width='45' style='padding:10px;'/><h3>"+response.data[i].name+"</h3><p>"+response.data[i].description+"</p></li>";
}
$("#games_list").append(games_list);
$('#games_list').listview('refresh');
$('#games_list').addClass('my_li');
}
}
else
{
alert(MES_ERR_SERVER_ACCESS);
}
});
}
我怎樣才能做到這一點?
function update_list_games - work!如果打開games.html,然後運行並返回當前遊戲,但如果使用鏈接,則函數不會調用。 – Alex 2012-08-14 14:33:30