【发布时间】:2012-12-03 15:53:52
【问题描述】:
我正在使用 php 在我的页面中动态加载内容。 我想添加一个很好的效果,比如用 jquery 淡入。
但如果用户关闭了 javascript,我希望我的页面仍然有效。
这是我加载内容的 php 代码:
/// load page content
$pages_dir = 'content';
if(!empty($_GET['p'])) {
$pages = scandir($pages_dir, 0);
//delete . and ..
unset($pages[0], $pages[1]);
$p = $_GET['p'];
// only files that are in the array can be loaded
if (in_array($p. '.php', $pages)) {
include($pages_dir. '/'.$p. '.php');
} else {
echo 'This page is not available';
}
} else {
include($pages_dir. '/index.php');
}
【问题讨论】:
-
你的 PHP 代码在这里不相关;你能给我们展示你的 jQuery 代码吗?
-
所以,淡入发生在客户端,与 PHP 的关系为零。
-
迫使我坐在毫无意义的淡入效果中的页面/站点是我永远不会再访问的站点。现在给我我的数据/信息,不要浪费我的时间在无用的视觉效果上。
-
@MarcB 虽然我同意,但我们并不是真正的usability site ;) 我们只是来解决程序员面临的技术问题。
标签: php jquery loading dynamic-loading