Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: 867V309
Prove it.

Did you ever notice how, when an FR page first loads, the times are all Pacific? Then they suddenly change to your computer's timezone and chosen date/time format? Here's the code:

// NG_Localize -- replace "date" class spans with localized date.
// <span class="date">11/19/2006 02:17 PM PST</span> gets localized.
function NG_Localize() {
    var tags = document.getElementsByTagName("span");
    for (var i = 0; i < tags.length; i ++) {
        if (tags[i].className == "date") {
            var da = new Date(tags[i].innerHTML); 
            if (da.getFullYear() > 1990) tags[i].innerHTML = da.toLocaleString();

            //var dy = da.getFullYear(); if (dy < 1970) dy = dy + 100;
            //var dm = da.getMonth() + 1; if (dm < 10) dm = "0" + dm;
            //var dd = da.getDate(); if (dd < 10) dd = "0" + dd;
            //var tm = da.getMinutes(); if (tm < 10) tm = "0" + tm;
            //var th = da.getHours() % 12; if (th == 0) th = 12; if (th < 10) th = "0" + th;
            //var tf = da.getHours() < 12 ? "AM" : "PM";
            //tags[i].innerHTML = dm + "/" + dd + "/" + dy + " " + th + ":" + tm + " " + tf;
        }
    }
}

What does it do? It rifles through all of the <span> tags on the page and for each one tagged with class 'date' which appears to contain a date/time, it replaces the date/time with a version localized to your computer.

It's from http://freerepublic.com/l/common.js. Click the link and see for yourself. That file is brought in from line 50 of this page's html source:

<script type="text/javascript" src="/l/common.js"></script>

Here's another JavaScript invocation that may cause some tinfoil to arc-over (it's from the bottom of the page):

    <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
    <script type="text/javascript">_uacct = "UA-2288668-1"; urchinTracker();</script>

39 posted on 02/06/2015 8:30:16 PM PST by cynwoody
[ Post Reply | Private Reply | To 37 | View Replies ]


To: cynwoody
Right, but those are their scripts, not yours.

YOU cannot post scripts to play video or do other obnoxious things, as the OP requested.


40 posted on 02/06/2015 8:38:32 PM PST by 867V309 (Boehner is the new Pelosi)
[ Post Reply | Private Reply | To 39 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson