Author |
Topic |
balexandre
Junior Member
Denmark
418 Posts |
Posted - 14 January 2009 : 07:59:56
|
the script should always be in the <HEAD> tag, that's were the scripts should be!
if you want to include in the <BODY> at least you need to include it before the closing tag </BODY>
so this:
Response.write "</table>" & vbNewLine
end if
response.write "</body>" & vbNewLine & _
"</html>" & vbNewLine
my_Conn.Close
set my_Conn = nothing
%>
should became this:
Response.write "</table>" & vbNewLine
end if
%>
<!-- START GOOGLE ANALYTICS -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-5279273-1");
pageTracker._trackPageview();
} catch(err) {}</script>
<!-- END GOOGLE ANALYTICS -->
<%
response.write "</body>" & vbNewLine & _
"</html>" & vbNewLine
my_Conn.Close
set my_Conn = nothing
%> < |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
Edited by - balexandre on 14 January 2009 08:00:43 |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 14 January 2009 : 09:08:33
|
quote: the script should always be in the <HEAD> tag, that's were the scripts should be!
not according to google, according to google the code should go above the terminating body tag not in the header,it is placed there is so that the js runs when the page has finished loading rather then when the header is loaded, so it accurately records page loads rather than half loaded aborted pages, it can go anywhere else in the body tag, but it is preferable at the bottom so that page views are more accurate.< |
|
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 14 January 2009 : 10:23:46
|
I said from the HTML specs, Google is just a company, are we all google dependents? if they say jump, will we jump?
shouldn't we develop proper code, and follow what standards are?
This is a lot to make a conversation of, I'm done by here!
if you wanna run scripts when the documents ends loading how about:
$(document).ready(function() { // do stuff when DOM is ready }); < |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 14 January 2009 : 10:33:55
|
The standards say you can put scripts wherever the hell you want to, but preference the <head> - if you're going to use Google Analytics, than you may want to do as Google reccomends for Google's product.< |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 14 January 2009 : 10:46:30
|
quote: Originally posted by balexandre
I said from the HTML specs, Google is just a company, are we all google dependents? if they say jump, will we jump?
shouldn't we develop proper code, and follow what standards are?
This is a lot to make a conversation of, I'm done by here!
if you wanna run scripts when the documents ends loading how about:
$(document).ready(function() { // do stuff when DOM is ready });
you didn't mention any specs in your post, and it is googles code so you should listen to google and put it where they bloody tell you to. there is nothing 'unproper' about googles code or where they want you to put it< |
|
|
Podge
Support Moderator
Ireland
3775 Posts |
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 14 January 2009 : 11:24:44
|
I would love to know why you double post my post?< |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
|
|
akintosyali
Starting Member
23 Posts |
Posted - 14 January 2009 : 11:37:03
|
it worked!! awesome!! Thanks everyone!!< |
|
|
Podge
Support Moderator
Ireland
3775 Posts |
|
sikandar
Junior Member
Pakistan
135 Posts |
|
Topic |
|