我想在出现新页面后运行脚本。这样做:在 index.html(链接)中:
<a href="games.html" data-transition="slide"><img src="./images/1.jpg" alt="" width='100'/></a>
在games.html中,但这段代码不会运行:
$(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);
}
});
}
我怎样才能做到这一点?