简体   繁体   中英

is it possible to detect viewport width and write to mysql in jquery and then retrieve width in php without page reload

thanks for reading...

It is my understanding (which my be wrong) content hidden with css loads but is kept hidden. Rather than using media queries to toggle hidden/visible content depending on the device, I was wondering if it is possible to use jquery on the page load to get the viewport width... and then write the width to mysql... and then retrieve the width with php on the same page without a page re-load.

If so, how would the jquery be written?

Thanks in advance for taking the time to read, Pete

My Found Solution:

After spending the day yesterday testing and trying different approaches I found this plugin this morning which solved my problem.

The goal was to prevent the loading of hidden code depending on viewpoint size. My original programming used toggles shown/hidden by media queries. Use of the Mobile Detect plugin allows the use of php if statements depending on device. A recommended plugin for sure.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM