David Westerfield

Gospel. Culture. Technology. Music.


Useful Protocol-Intelligent Javascript Code (Update 3)

Well, in this third installment of “Useful Protocol-Intelligent Javascript Code,” (not intending it to become a series, ha) I was sent a link by Matt Hinze where someone has already written some code that will do this exact thing, particularly for Google analytics js code. Take a look:

<script type=”text/javascript”>
document.write( ‘<scr’+’ipt type=”text/javascript” src=”‘ );
if( document.location.toString().indexOf( ‘https://’ ) != -1 ) {
document.write( ‘https://ssl’ ); } else { document.write( ‘http://www’ ); }
document.write( ‘.google-analytics.com/urchin.js”></scr’+’ipt>’ );
</script>

<script type=”text/javascript”>
_uacct = “UA-XXXXXXX-X”;
urchinTracker();
</script>

<script type=”text/javascript”>
document.write( ‘<scr’+’ipt type=”text/javascript”>’ );
if( document.referrer.toString().indexOf( ‘www.westerfunk.net’ ) ==-1 ) {
document.write( ‘urchinTracker(document.referrer);’ ); }
document.write( ‘</scr’+’ipt>’ );
</script>

I have set this up on Westerfunk.net and will see what the results look like tomorrow, to see if the code is actually rendering properly. So far it appears it is actually making the calls out to google on every page hit, but only G-analytics results will shed light on this theory.

Blog entry where the code came from:

(Original): http://www.reubenyau.com/google-analyti … rrer-only/
(Archived): http://www.westerfunk.net/archives/tech … er%20Only/

Update:
————————————————————-

This appears to be working very well and all my stats look back to normal on google-analytics. So this code is good …

Gospel/Christ-Centered Teaching Philosophy

Great quote by Tim Keller:

“At the heart of Redeemer’s ministry and its philosophy of preaching to post-modern audiences is the conviction that ‘the gospel’ is not just a way to be saved from the penalty of sin, but is the fundamental dynamic for living the whole Christian life–individually and corporately, privately and publicly. In other words, the gospel is not just for non-Christians, but also for Christians. This means the gospel is not just the A-B-C’s but the A to Z of the Christian life. It is not accurate to think ‘the gospel’ is what saves non-Christians, and then, what matures Christians is trying hard to live according to Biblical principles. It is more accurate to say that we are saved by believing the gospel, and then we are transformed in every part of our mind, heart, and life by believing the gospel more and more deeply as our life goes on.”

Useful Protocol-Intelligent Javascript Code (Update 2)

Well after coming across some issues with the last version of code (i.e. when visiting the website, it wasn’t always rendering the google analytics javascript like it should have been, as reflected in the reports on google’s site). For the past two days, it only showed two hits. So I have now reverted back to my original if/else js code. I guess maybe it was getting cached or not finishing on some browsers or something. Strange …

White vs. Bryson: Debating Calvinism (John 6:44)

“No one can come to me unless the Father who sent me draws him. And I will raise him up on the last day.” – John 6:44

When sticking with this one verse (Jesus’ own statement) you cannot escape the conclusion: No one comes to Jesus, believes in Jesus, cares anything about Jesus, unless the Father who sent Jesus draws that person to Him, and the one who comes to Christ in faith will be raised on the last day. Which comes first, the giving of the person by the Father to Jesus, or the person coming to Jesus? This verse is clear. The Father does something that has an effect. Regeneration (the new birth) precedes and gives rise to faith, monergism. Bryson attempts to reconcile his free-will theology with what is plainly stated in this verse.

Useful Protocol-Intelligent Javascript Code (Update)

Thanks to the help of a friend named Matt Hinze, this javascript code can be simplified. Here’s the code:

<script language=”JavaScript” type=”text/javascript”>

var url = window.location.protocol == ‘https:’ ? ‘https://ssl.google-analytics.com/urchin.js’ : ‘http://www.google-analytics.com/urchin.js’;
document.write(‘<scr’+’ipt src=”‘ + url + ‘” type=”text/javascript”>’);
document.write(‘<scr’+’ipt src=”/google.js” type=”text/javascript”>’);

</script>

Does James Contradict Paul?

Excellent Exegesis:

(Original): http://www.desiringgod.org/ResourceLibr … dict_Paul/
(Archived): http://www.westerfunk.net/archives/theo … n%20Piper/

What do you think?

Do you think this guy did anything wrong? People in the audience don’t seem to think so as you can hear in the video … granted he did kind of lose it there, but what did he initially do? Just asked a question? And was the tazing really necessary by the police? In the second video they said he was inciting a riot? Please …

Useful Protocol-Intelligent Javascript

This is really cool. I modified this to make it possible to differentiate HTTP/S protocols. If you are running a web site where you have both secure (HTTPS) and unsecured (HTTP) information, but want certain data to only show up on the secure pages, this will do it. On the clients’ machine, when downloading the html from the web server, this javascript will detect what protocol is being utilized (either regular HTTP or HTTPS) and render the code accordingly. I modified the code for my Google Analytics tags so that when using HTTPS it will utilize https://ssl.google-analytics.com/urchin.js for secure connections instead of http://www.google-analytics.com/urchin.js for the unsecured connections. I’ll show you my example code:

<script language=”JavaScript” type=”text/JavaScript”>
if (window.location.protocol.indexOf(‘https:’)==0?’s’:”)
{
document.write(‘<scr’+’ipt src=”https://ssl.google-analytics.com/urchin.js” type=”text/javascript”>’);
document.write(‘<scr’+’ipt src=”/google.js” type=”text/javascript”>’);
}

else
{
document.write(‘<scr’+’ipt src=”http://www.google-analytics.com/urchin.js” type=”text/javascript”>’);
document.write(‘<scr’+’ipt src=”/google.js” type=”text/javascript”>’);
}
</script>

Petraeus assessment on Iraq questioned

Of course it is, why would anyone think it wouldn’t be? Absurd … and MoveOn.org? What a disgraceful organization. http://www.westerfunk.net/archives/poli … 9.10.2007/ Did people speak like this during World War II? Would we have won the fight if the troops always heard such nay-saying all the time? And would the government have put up with such non-sense back then? I don’t think so …

http://news.yahoo.com/s/ap/20070910/ap_on_go_co/us_iraq

Historical Extrapolations and Eisegesis Concerning Jesus and Mary Magdelene

What a poor excuse for good historical research. Just shows how major media wants to change people’s minds concerning Christianity without giving people any real historical facts. I mean really, Jesus addresses His wife and son from the cross? Please … and I like the question from the narrator concerning John 19 when from the cross Jesus tells John (the disciple) to take care of His mother, Mary, “But can this [understanding] be later theology? Could it be that Jesus was talking to Mary Magdalene, his wife, asking her to protect their son?” Well, umm, no. And it can be historically proven. It’s amazing what actually goes as scholarship nowadays. You can just get a Ph.d in front of your name, make some controversial claims concerning Christ with historical data taken out of context or completely wrong, and end up as a historical source on the Discovery Channel. Amazing. Why is it there are all these specials on Christianity, attempting to debunk it historically? What about Islam or other religions? It just comes down to the fact that the world hates Christ and wants to suppress Him as long as they can. If they can go to the Scriptures and get people to think they are unreliable, then maybe they can turn people away from Christianity, is their thought.

Page 81 of 118

Powered by WordPress & Theme by Anders Norén