Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/111.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Can';不在页面上显示块隐藏事件_Javascript_Ios_Mobile - Fatal编程技术网

Javascript Can';不在页面上显示块隐藏事件

Javascript Can';不在页面上显示块隐藏事件,javascript,ios,mobile,Javascript,Ios,Mobile,当浏览器在页面之间切换时,我需要显示预加载程序块。 在ios上,事件正在处理,可以显示“警报”,但DOM操作似乎不起作用 // Bind a change handler to the window location. $(window).bind('pagehide', function(){ alert('pagehide fired'); $(target).show(); }); 目标在哪里定义?控制台中有错误吗?没有,我没有错误,target只是前面几行中定义的DOM元素。我

当浏览器在页面之间切换时,我需要显示预加载程序块。 在ios上,事件正在处理,可以显示“警报”,但DOM操作似乎不起作用

// Bind a change handler to the window location.
$(window).bind('pagehide', function(){
  alert('pagehide fired');
  $(target).show();
});

目标在哪里定义?控制台中有错误吗?没有,我没有错误,
target
只是前面几行中定义的DOM元素。我可以确认(移动和非移动)safari中的行为。在其他浏览器中,可以对onbeforeunload和onpagehide事件进行DOM操作,但在safari中不行:(