我的网站将访问者恢复为一个单独的移动网站,在线阅读一些指南后,这似乎相当简单.
但是,我希望人们能够点击移动网站上的链接,然后将其带到桌面网站.
我看到的问题是,如果我链接回桌面网站,它只会重定向它们,如果它们在移动设备上?
我怎么能绕过这个?
可能重复:
CSS媒体类型:如何为移动设备加载CSS?
我正处于项目中间,您可以看到我在源代码中使用的所有代码.
在主页上有一个轻量级的javascript滑块,问题是由于某些原因它在移动设备上使用时不显示.那么任何人都可以帮我提出一个解决方案或告诉我如何在移动设备上观看不同的东西吗?
为了显示不同的IE样式,我使用它:
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/ie.css" />
<![endif]-->
Run Code Online (Sandbox Code Playgroud)
手机有类似的东西吗?
我有一个PHP脚本(粘贴在下面)从URL列表中提取元数据,问题是它可能需要一段时间才能加载,用户永远不知道它何时完成(除非他们密切关注加载图标)他们的broswer标签)
我已经在网上浏览了很长时间但找不到解决方案,我已经读过我可以使用Ajax但是我怎么能在这个脚本上使用它?
谢谢您的帮助!
<script type="text/javascript">
function showContent(vThis)
{
// http://www.javascriptjunkie.com
// alert(vSibling.className + " " + vDef_Key);
vParent = vThis.parentNode;
vSibling = vParent.nextSibling;
while (vSibling.nodeType==3) { // Fix for Mozilla/FireFox Empty Space becomes a TextNode or Something
vSibling = vSibling.nextSibling;
};
if(vSibling.style.display == "none")
{
vThis.src="collapse.gif";
vThis.alt = "Hide Div";
vSibling.style.display = "block";
} else {
vSibling.style.display = "none";
vThis.src="expand.gif";
vThis.alt = "Show Div";
}
return;
}
</script>
<form method="POST" action=<?php echo "'".$_SERVER['PHP_SELF']."'";?> >
<textarea name="siteurl" rows="10" cols="50">
<?php //Check …Run Code Online (Sandbox Code Playgroud) 我有一个脚本从URL列表中提取元数据但是当我尝试输出太多时它表示URL太长而且不会运行.
我的问题是如何阻止这种情况发生?
<?php
ini_set( 'default_charset', 'UTF-8' );
error_reporting(E_ALL);
//ini_set( "display_errors", 0);
function parseUrl($url){
//Trim whitespace of the url to ensure proper checking.
$url = trim($url);
//Check if a protocol is specified at the beginning of the url. If it's not, prepend 'http://'.
if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
$url = "http://" . $url;
}
//Check if '/' is present at the end of the url. If not, append '/'.
if (substr($url, -1)!=="/"){
$url .= "/";
}
//Return the processed url.
return $url; …Run Code Online (Sandbox Code Playgroud) 这必须是一个简单的解决方案,但我无法理解!
我通过PHP将标题包含到每个新页面中,标题包含CSS和脚本等.
唯一的问题是因为页面位于不同的目录中,当我链接到像../header等标题时它看起来很好但是包含的脚本是通过短URL包含的,例如/js/script.js
这意味着在页面上(在另一个目录中)脚本不起作用!
我发现很难解释,但看看这个:
http://www.healthygit.com/
Run Code Online (Sandbox Code Playgroud)
如果您查看源,所有脚本链接都很好.
现在看看这个:
http://www.healthygit.com/fitness/running.php
Run Code Online (Sandbox Code Playgroud)
如果您尝试单击某个脚本进行查看,则会将您带到404,或者在这种情况下302将您带到主页.