js中的新手让我慢一点:D需要根据用户使用的os进行重定向.如果ios重定向到x,如果android重定向到y,else..stay在原始地址上.我的问题:
这些片段足够吗?
<script type="text/javascript"> // <![CDATA[
if ( (navigator.userAgent.indexOf('Android') != -1) ) {
document.location = "y";
} // ]]>
</script>
<script type="text/javascript"> // <![CDATA[
if ((navigator.userAgent.indexOf('iPhone') != -1) || (navigator.userAgent.indexOf('iPod') != -1) || (navigator.userAgent.indexOf('iPad') != -1)) {
document.location = "x";
} // ]]>
</script>
Run Code Online (Sandbox Code Playgroud)
谢谢!:D
我正在尝试制作一个wordpress插件,我遇到了一个问题.
问题是更新查询,我无法弄清楚它为什么不起作用.查询应更新非wordpress表
global $wpdb;
$sql ="UPDATE $lmdisp_table_name
SET `".$lmdisp_nume."`=".$nume.",
`".$lmdisp_departament."` = ".$dep.",
`".$lmdisp_an."` = ".$an.",
`".$lmdisp_grupaserie."` = ".$grupa.",
`".$lmdisp_tel."` = ".$tel."' ,
`".$lmdisp_email."` = ".$email.",
`".$lmdisp_fb."` = ".$fb.",
`".$lmdisp_tw."` = ".$tw.",
`".$lmdisp_linked."` = ".$linked.",
`".$lmdisp_freel."` = ".$freel.",
`".$lmdisp_blog."` = ".$blog.",
`".$lmdisp_memyear."` = ".$memyear.",
`".$lmdisp_fctlse."` = ".$fct.",
`".$lmdisp_evlse."` = ".$evlse.",
`".$lmdisp_skills."` = ".$skills.",
`".$lmdisp_avatar."` = ".$avatar.",
`".$lmdisp_cv."` = ".$cv."
WHERE `".$lmdisp_id."` = ".$id."";
$rez = $wpdb->query($sql);
Run Code Online (Sandbox Code Playgroud)
一点帮助 ?:(