Can I enable javascript directly from my site? [closed] - javascript

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 4 years ago.
Improve this question
I would like to know if it is possible with the help of a button for example, to allow the user to enable javascript or disable it (but only enable it interests me) directly from our site.
That is to say, I have a website that needs javascript for animations or whatever and I would like everyone to be able to access it.
So make available to people a button to enable javascript if it is disabled.
Do you know what I'm talking about?
Is this possible? Or am I dreaming?
And if so, do you have any leads?

Not possible, but the best you can do is add a <noscript> tag with a message specifically for people without JS enabled. A huge majority of people keep JS enabled and never change this preference though.
Example:
<noscript>
<h1>Please enable JavaScript in your browser for the best possible experience.</h1>
</noscript>

Related

How to pin a website to windows taskbar programmatically using javascript? [closed]

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 4 years ago.
Improve this question
I can't use drag and drop method. I have gone through the jquery pinify plugin, but what I understood is that, it only encourage user to pin website using drag and drop using intelligent popups rather than doing it on it's own.
Is this even possible?
No luckily this is not possible.
Imagine the security reasons behind it. No website can change something on your OS. (At least that's what we all hope, that's why I say "luckily" we have a problem if this would not be like so).
Or imagine this: You create a website. The font is defined by designers and project managers which discussed which font and which font-size will be the best to represent the company on the web. So you created the website based on those requirements. But now, I have some issues with my eyes. This is why I setup my browser with a default font-size. This is what I need, to read any content from the web. Now, NO! You can not change this! Why? Because I have set something in my browser settings, also those are part of my "personal" settings. You can not look into them and you obviously can not change them. Hope this helps.

How would one implement custom themes into a website that is not wordpress? [closed]

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 5 years ago.
Improve this question
So i'm building a website in PHP7, HTML5, CSS3, JQuery, JavaScript5 not WordPress to be clear. One feature i would like is to allow users to change their theme to something that is not default theme so how would one do this i mean making the theme and implementing them? Would it just be an element say a drop down box with CSS documents or something else?p.s. my other questions did not go down well so if this does not make sense or is unclear please let me know so i can improve it.
I didn't get your question exactly. But these are my opinions.
Generally , Custom Themes are added using themes(Non Wordpress) which you can download from sites like themeforest , envato market ,template.net etc. Either you can tweak it and make it your own or just use as it is. But if you do so please do have a glance at the licensing to avoid future problems.
And Dropdown menu can be made using CSS and JavaScript. I would say that its not a must. Its the content which makes it notable.

How do I validate HTML with Javascript? [closed]

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 7 years ago.
Improve this question
I would like to verify that a string is valid HTML, like the W3C Service does. I specifically don't want any browser corrections (like closing open tags), which precludes options that create DOM elements and read the HTML from them. It will run very frequently, so I really need to run it locally. Libraries are OK, jQuery is OK.
Edit #1: I'm asking about HTML validation, not form or input validation.
Edit #2: What I need is basically a Javascript implementation of the Nu HTML Checker.
Provided you're running node.js or python on the server side you can use a library like html5-lint by Mozilla to do all the heavy lifting for you. And for the java world there is a similar library jtidy and there are countless of similar libraries out there.

Is it possible to enable javascript for a specific URL? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
There are many users who have JavaScript disabled and deny to enable it even for some business applications. Is there any way to allow a user to enable a JavaScript for a specific URL in order to use an application and then to disable again for the rest of URLs?
Thank you very much!
In Windows, you can configure site zones. You could disable Javascript for all URL's in the main config, then enable it only for sites in the safe zone. You then add the white listed sites where you want JS to work to the safe zone. I'm afraid this only affects IE, though. Also, this kind of question is more suited to Super User.

Can I use javascript to detect a mobile device and restrict access to a normal browser? [closed]

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.

Categories