久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

“查看完整站點(diǎn)"移動(dòng)站點(diǎn)選項(xiàng)

quot;VIEW FULL SITEquot; mobile site option(“查看完整站點(diǎn)移動(dòng)站點(diǎn)選項(xiàng))
本文介紹了“查看完整站點(diǎn)"移動(dòng)站點(diǎn)選項(xiàng)的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

限時(shí)送ChatGPT賬號(hào)..

所以我正在開發(fā)我正在做的網(wǎng)站的移動(dòng)版本,并且到目前為止,我將移動(dòng)網(wǎng)站內(nèi)容從其主要對(duì)應(yīng)物主站點(diǎn)中提取.

So I'm working on the mobile version of a site I'm doing, and so far, I'm pulling the mobile sites content from its main counterpart, the main site.

當(dāng)我研究一些移動(dòng)網(wǎng)站時(shí),我注意到很多網(wǎng)站都有查看完整網(wǎng)站"鏈接.

As I study some mobile sites out there, I notice a lot of em have a "view full site" link.

現(xiàn)在我計(jì)劃通過檢查屏幕寬度等在主站點(diǎn)的標(biāo)題標(biāo)簽中通過 .js 重定向移動(dòng)訪問者......(不確定這是否是最好的方法,但到目前為止我腦子里最簡單的方法))(但也歡迎提出建議)但是像這樣

Now I plan on redirecting the mobile visitors via .js in the header tag on main site via a check for screen width etc...(not sure if its the best way but so far the easiest on my brain))(but suggestions also welcome) but something like this

if (screen.width<=XyZ||screen.height<=XyZ) //example iphone size lets say 320x480
window.location.replace("mobile site link here.")

我不知道這是否是最好的方法,但在虛擬測試中,它適用于 iPhone、一些朋友 Droids 和一個(gè)黑莓.但它有效.

Again I dont know if this is the best way but, on dummy tests, it works on iPhone, some friends Droids, and one Blackberry. But it works.

無論如何,所以我的問題是,如果我在每個(gè)頁面上都進(jìn)行此檢查...我怎么可能有查看完整站點(diǎn)"選項(xiàng)?

Anyways, so my question is, if i do this check on every page...how can I possible have a "view full site" option?

推薦答案

使用 PHP 通過 $_SERVER['HTTP_USER_AGENT'] 檢測移動(dòng)用戶.JavaScript 檢測可能不可靠,因?yàn)樵S多移動(dòng)瀏覽器不支持 JS.查看完整站點(diǎn)"將設(shè)置 cookie 以拒絕可檢測到的移動(dòng)站點(diǎn).使用 cookie 來跟蹤用戶的偏好.

Use PHP to detect mobile users through $_SERVER['HTTP_USER_AGENT']. JavaScript detection may not be reliable, because many mobile browsers do not support JS. A "View Full Site" will set a cookie to reject mobile site, which is detectable. Use cookies to keep track of your user's preferences.

在骨架中

<?php

if (isset($_COOKIE['nomobile'])) {
  $style = "normal";
} else {

if (preg_match('/iPhone|(...etc...)/', $_SERVER['HTTP_USER_AGENT'])) {
   $style = "mobile";
} else {
   $style = "normal";
}

}

對(duì)于查看完整站點(diǎn)"頁面:

For the "View Full Site" page:

<a href="fullsite.php">Full Site</a>

fullsite.php

<?php
   setcookie('nomobile', 'true');
   header('Location: index.php');
?>

這篇關(guān)于“查看完整站點(diǎn)"移動(dòng)站點(diǎn)選項(xiàng)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Add programmatically a downloadable file to Woocommerce products(以編程方式將可下載文件添加到 Woocommerce 產(chǎn)品)
Get today#39;s total orders count for each product in Woocommerce(獲取今天 Woocommerce 中每種產(chǎn)品的總訂單數(shù))
Add Custom registration fields in WooCommerce and phone field validation issue(在 WooCommerce 和電話字段驗(yàn)證問題中添加自定義注冊(cè)字段)
Add a select field that will change price in Woocommerce simple products(在 Woocommerce 簡單產(chǎn)品中添加一個(gè)將更改價(jià)格的選擇字段)
Add custom columns to admin products list in WooCommerce 3(在 WooCommerce 3 中將自定義列添加到管理產(chǎn)品列表)
Customizing checkout quot;Place Orderquot; button output html(自定義結(jié)帳“下訂單按鈕輸出html)
主站蜘蛛池模板: 欧美成人在线免费 | 欧美在线观看一区 | 欧美日日 | 国产一级黄色网 | 成人18亚洲xxoo | 久久久久久久一区 | 全免一级毛片 | 91网视频 | 欧美黄a | 免费视频久久 | 久久国产精品久久 | 国产一级在线 | 国产精品中文字幕一区二区三区 | 日韩二区三区 | 亚洲欧美另类在线 | av一区二区三区四区 | 亚洲综合资源 | 国产区高清 | 精品三区 | 91大神新作在线观看 | 日韩av一二三区 | 成人在线视频免费播放 | 亚洲精品久久久一区二区三区 | 亚洲综合色视频在线观看 | 99精品久久久久久中文字幕 | 色婷婷一区二区三区四区 | 精品国产一区二区三区久久久蜜月 | 日韩免费一二三区 | 成人免费在线播放视频 | 91av大全| 日韩欧美综合在线视频 | 国产成年人视频 | 国产精品久久久久久久久久免费看 | 日韩电影一区 | 欧美日韩国产一区二区三区 | 国产精品欧美一区二区三区不卡 | 男人的天堂久久 | 亚洲精品日韩精品 | 国产精品久久7777777 | 国产在线一区二区三区 | 99久久久久国产精品免费 |