I have some page, which have mobile version (mobile version runnig automatically when we use mobile device). I would like to put that page in iframe on my page in mobile version. If is a way to force mobile version in iframe?
I assume that the mobile device detection is now based on user_agent.
To enforce mobile rendering i suggest, to add "?device=mobile" to the URL of the src element of the iframe. Then add a simple if-condition to the mobile device detection function, which checks for $_GET['device'] == 'mobile' and set the rendering to "mobile".
If you are requesting the iframe via Ajax, you could try an approach, where you simply set a custom HEADER attribute.
Related
I have a website that is using two different views, namely desktop and mobile. Generally for blogs hosted on Blogger will display a mobile version of your blog when combined ?m=1 at the end of the blog url.
My website is quite risky if the user turns using chrome or another browser to the desktop but with an additional open my web ?m=1
Now I ask.
Is it possible to prohibit the user opens the mobile version of my blog when he used the computer / PC / Laptop?
Please explain, thank you
We can detect the UserAgent of the browser and if it isn't mobile, then we can replace the query parameter m=1 with m=0 (which redirects to the desktop version)
Adding the following code to the <head> tag of the template should work (The UserAgent condition courtesy of What is the best way to detect a mobile device ) -
<script>
if(!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && location.search.match("m=1") != null)
{
location.search = location.search.replace('m=1','m=0')
}
</script>
Note: Make sure that you are using the Custom Mobile template to make this work (In Blogger dashboard > Template tab > Gear Icon > Check Yes. Show mobile template on mobile devices. > Select Custom in Choose mobile template dropdown )
In Ionic project, I had loaded my Responsive Website URL in an iFrame and it looks fine. But there are few anchor links in my website which will open a new window, for eg :
Devices List
This is working fine for Desktop browsers, but the same is not opening any new window or not even opening in default browser. Am seeing this problem only with iFrame. I tried with Different targets and also used InAppBrowser, no progress.
Might be of help to someone blocked due to this
Devices List
This will get reference to parent container window object and will work as expected.
I want to redirect the user to m.domainname.com on his mobile browser. I want to use the existing website but redirect to the m.domainname.com.
For that how can i detect the user is on mobile or desktop.
And how can i redirect the mobile version of same site.
using media screen i can create the seprate displays for mobile divices
using bootstrap i can create the responsive website. but when its on mobile browser i want to redirect the mobile version like m.domainname.com
How can i do this?
And my website is in django.
You can use something like this: https://github.com/gregmuellegger/django-mobile
The idea is to detect mobile device in middleware (https://docs.djangoproject.com/en/dev/topics/http/middleware/).
So, if middleware detects that request going from mobile device, and user requested the normal version of the site, you can redirect him to mobile version of the site.
I am working on a site that has a mobile site: http://www.exchequersolutions.co.uk/m/ I am trying to create a link to the desktop site with out much luck.
When the user clicks on a link I want them to be taken to the desktop site.
The link in the anchor tag is:
<p><a href="http://www.exchequersolutions.co.uk/contractors/cis-self-employed/cis-form/" target="_blank" class="cis_register" >Register Online</a></p>
Does anybody know how or even if this is possible?
Is not possible.
Every browser implement a function to save a link on OS FileSystem (drag&drop or file > save as ...).
You're stuck in a loop caused by user-agent detection.
It looks like there is device detection on the desktop site that uses the user-agent to identify mobile devices. If you follow a link to the desktop site using a mobile phone, you'll just be sent back to the mobile site.
There are a few different ways you can fix this, but it depends on your site architecture. One way would be to disable the redirect on the desktop site if you include a specific parameter in the query string. Another option would be to set a cookie and use that to disable the redirect.
I haven't got answer so I am updating this question
as per the reply from Mr. Seanrose the link should adjust on the mobile vieport but it doesnt, so is there any other link I should use for authantication on the mobile ?
I am developing the HTML5/javascript based mobile application for box. for getting the auth code I use following url
https://www.box.com/api/oauth2/authorize?response_type=code&client_id=' + CLIENT_ID + '&state=authenticated'
but this is non mobile url hence the page is getting displayed very small. is there mobile specific URL for authentication ?
Thanks for the support
When you visit that page from a mobile device, it should detect viewport dimensions and adjust to a mobile-friendly page, like this: