TinyPortal

Development => Feedback => Topic started by: anunlike on August 31, 2006, 03:11:20 AM

Title: Check For Javascript, Etc.?
Post by: anunlike on August 31, 2006, 03:11:20 AM
I think something that would be pretty cool to have would be the ability for TP to check see if Javascript, etc. is enabled / installed in the browser.

Since certain SMF / TP functions use it, it'd be neat for it to automatically check, and if not enabled / installed, give a text message (or whatever) somewhere in a pretty obvious place stating so.

It's something that would be neat.
Title: Re: Check For Javascript, Etc.?
Post by: anunlike on August 31, 2006, 07:32:12 PM
I'm going to ask this at the SMF community forums and see what they say.
Title: Re: Check For Javascript, Etc.?
Post by: Jpg on August 31, 2006, 07:48:29 PM
Actually I think someone came out with something like that...brb with a snippet.


Here ya go.

<SCRIPT LANGUAGE="JavaScript">


<!--Edited By Alan S--!>
<!-- Begin
var xy = navigator.appVersion;
xz = xy.substring(0,4);
document.write("<center><table border=1 cellpadding=2><tr><td>");

document.write("<center><table border=1 cellpadding=2><tr>");
document.write("<td>Browser: </td><td><center>");
document.write("<b>", navigator.appCodeName,"</td></tr>");
document.write("<tr><td>Version: </td><td><center>");
document.write("<b>",xz,"</td></tr>");
document.write("<tr><td>Platform: </td><td><center>");
document.write("<b>", navigator.platform,"</td></tr>");
document.write("<tr><td>Pages Viewed: </td><td><center>");
document.write("<b>", history.length," </td></tr>");
document.write("<tr><td>Java enabled: </td><td><center><b>");
if (navigator.javaEnabled()) document.write("Yes!</td></tr>");
else document.write("Nope!</td></tr>")
document.write("<tr><td>Screen Resolution: </td><td><center>");
document.write("<b>",screen.width," x ",screen.height,"</td></tr>");
document.write("</table></tr></td></table></center>");
// End -->
</script>


It shows their Screen resolution, if java is enabled, Pages viewed, their platform, what browser they are using, and version they are using..
Title: Re: Check For Javascript, Etc.?
Post by: Jpg on August 31, 2006, 07:56:30 PM
The section you would want for Javascript.


<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
var xy = navigator.appVersion;
xz = xy.substring(0,4);
document.write("<center><table border=1 cellpadding=2><tr><td>");

document.write("<tr><td>Java enabled: </td><td><center><b>");
if (navigator.javaEnabled()) document.write("Yes!</td></tr>");
else document.write("Nope!</td></tr>")

// End -->
</script>


I haven't tested it so don't get mad at me if it doesn't work.
Title: Re: Check For Javascript, Etc.?
Post by: anunlike on August 31, 2006, 09:07:22 PM
Thanks.

I was just wanting to throw it out as a feature.
Title: Re: Check For Javascript, Etc.?
Post by: Jpg on August 31, 2006, 09:09:10 PM
Ok...and your welcome dude.
Title: Re: Check For Javascript, Etc.?
Post by: eldacar on September 01, 2006, 03:34:45 AM
<noscript>You don't have javascript!</noscript>
Title: Re: Check For Javascript, Etc.?
Post by: akulion on September 01, 2006, 03:44:34 AM
correction eldÊÅ'ka

Quote

<noscript>Stop living in the cave ages and get a real browser that works</noscript>

lol
Title: Re: Check For Javascript, Etc.?
Post by: IchBin on September 01, 2006, 05:02:39 AM
lmao Aku! That is so true. But you have to admit, eldÊÅ'kaː is right!
Title: Re: Check For Javascript, Etc.?
Post by: anunlike on September 01, 2006, 05:15:20 AM
Quote from: akulion on September 01, 2006, 03:44:34 AMcorrection eldÊÅ'ka
Quote

<noscript>Stop living in the cave ages and get a real browser that works</noscript>
lol

LMAO

But, some people may have the browser to support it, but they may have it turned off, have something that prevents it, etc. It'd be neat to have it built in, IMO.

For example, I've got the NoScript extension for FF and set to where I allow it on an indvidual basis. It's always cool to see the page telling me I have to allow it, so I don't have to remember.
Title: Re: Check For Javascript, Etc.?
Post by: akulion on September 01, 2006, 05:16:35 AM
how about a message like "u dont have javascript - now ur computer will self desruct

lol

im sure that person will never visit again :2funny:
Title: Re: Check For Javascript, Etc.?
Post by: Thurnok on September 01, 2006, 06:26:21 AM
LOL!

We should save things like this and put them all into code that only runs on Holloween!  LOL
Title: Re: Check For Javascript, Etc.?
Post by: Jpg on September 02, 2006, 12:24:38 AM
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
var xy = navigator.appVersion;
xz = xy.substring(0,4);
document.write("<center><table border=1 cellpadding=2><tr><td>");

document.write("<tr><td>Java enabled: </td><td><center><b>");
if (navigator.javaEnabled()) document.write("Javascript? Hack Time!</td></tr>");
else document.write("Your computer doesn't take javascript, now it will self-destruct!</td></tr>")

// End -->
</script>


Lol... try that.