Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I was wonder how facebook and google redial different links for different devices and also they redial there lite veesion to the android or IOS opera mini too. So i research a little bit and got some idea about detection user agent with java script but I can't find any real answer or code so that I can use it for my website.
So anyone know how its done and get me that code and I also think the php code would be the best if its possible cause user could disable there javascript.
Using PHP:
var_dump( $_SERVER['HTTP_USER_AGENT'] );
More at: PHP.net
Using Javascript:
alert( navigator.userAgent );
More at: W3School.com
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
How to save a website shortcut on your desktop using java script ?
Using JavaScript this is not possible, it is a security feature implemented by browsers. Spammy websites would abuse this feature.
I don't think it is possible : adding to desktop is an OS thing ; JS through browser is not allow to do that. I might be wrong but I'll be surprised.
You can invite the user to do so in a nice enthusiastic modal though!
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
how to create a chrome extension to get the number of installed plug-ins on my Browser?
Hello Everybody,
I wanna create a google chrome extension which gives me the total number of installed plug-ins on my browser. i am new in this developing field. where can i learn the advanced level javascript code to develop my skill. please help me.
thanks in advance.
You can utilize navigator.plugins
[].forEach.call(navigator.plugins, function(plugin,index) {
console.log(index, plugin.name, plugin.filename, plugin.description)
})
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I've created a few simple HTML/CSS/JS games. This time a few friends and I are going to create another game that people can download from some website. We want to use HTML CSS and JS even though that is probably not the best option.
All the games I created before I've used Chrome to run them. Of course I can't just make people run my games with Chrome. So how should I run it?
You can try using Electron (http://electron.atom.io/). You can use it to build desktop apps using Html/Css/Js.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I want my web page to detect whether the user is using a handheld device and if so allow access to mobile site and if not redirect to main site. I am assuming this would be done in JavaScript. Can anyone help me or point me in the right direction.
EDIT
I would still like to use javascript as it is the language I have used throughout the project.
SOLVED
<script language="javascript">
var mobile = (/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));
if (mobile) {
window.location.replace("http://scmweb.infj.
ulst.ac.uk/~b00519427/finalwebsite/homepage.html");
}
else
window.location.replace("http://scm.ulster.ac.uk/");
</script>
SOLVED
To really enforce a particular site, JS is not the right choice since it can easily be disabled. Hence, I would propose a server side decision and enforcement. For this, you can use a .htaccess file and the USER_AGENT rule, as described in this answer.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am making an open-source addon for firefox and chrome called and I am wondering if there is a way to control an email service like yahoo using javascript?
You can control the look of the page and probably (although I cannot be sure) send and edit messages without having to use the on-page buttons, but you cannot do server-side stuff such as logging into an account from a page without a log-in on it or sending a message from a page other than the email sending page. If you have any specific questions about controlling one specific thing, please add them in the comments, and I may answer them.