开发者

Non-JavaScript pop-up for non-JavaScript users?

I was wondering if it's possible at all to d开发者_运维技巧o something like the following:

Let the website examine whether a visitor has Javascript enabled or not. If not a pop-up will appear telling them to enable JavaScript for a better website view.

It doesn't have to be a pop-up, it could be anything, really.

Is it even possible to do something like that without using JavaScript?

In the worst case scenario I just leave a plain text note in my footer or so.


Anything inside a <noscript> block will only be shown to people with JavaScript disabled or unavailable:

<noscript>
  Please enable JavaScript to see the awesomeness
</noscript>


All you need is noscript tag

<noscript>
  Doh! No javascript?
</noscript>


You could use <noscript>, but there may be unintended side effects. Instead, Include a <div>, and then remove it from the DOM on document.ready. That way, the message is sure to appear if your script doesn't run for any reason.


From my reading here is a way to do it:

in your HTML add a text that tell the user to enable javascript for better view. Then on the load of the page remove the DOM.

source : "Jquery novice to ninja" p.64 In HTML

<p id="no-script"> We recommend that you have JavaScript enabled!</p> 

In Javascript

$('#no-script').remove();


That's difficult to answer you because Java is not Javascript.

Javascript is a native browser language. Java is an advanced language which needs plugin to run on browser (applet).

If you talk about javascript, you can use the noscript tag.

If you talk about java, you can use javascript to show a popup because javascript is activated on 99% of browsers.


Try this - Visual basic Script (For IE only):

<script type="text/vbscript">

MsgBox("Please Enable Javascript to experience the full quality of this page...")

</script>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜