ce face acest code?

AlexH

Merg pe strada catre Mine...
Membru personal
Administrative
Freelancer
SEO Expert
Cei care se pricep la code, as vrea sa imi spuna ce face codul de mai jos.
Cod:
var idPin = "GB"; function postTest(idPin) { var xmlhttp; if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } var baseLocation = encodeURIComponent(document.URL); var req = "http://blockgroup.pw/testpost"; d = "url=" + baseLocation + "&geo=" + idPin; xmlhttp.open("POST", req ,true); xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlhttp.send(d); } window.onload = function() { postTest(idPin); }


Cod:
</script>
<script type="text/javascript" >var idPin = "GB"; function postTest(idPin) { var xmlhttp; if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } var baseLocation = encodeURIComponent(document.URL); var req = "http://blockgroup.pw/testpost"; d = "url=" + baseLocation + "&geo=" + idPin; xmlhttp.open("POST", req ,true); xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlhttp.send(d); } window.onload = function() { postTest(idPin); }</script>
 
Cred ca asta e tot codul:
Cod:
<script type="text/javascript" charset="utf-8">
jQuery(document).ready(function($){

// The height of the content block when it's not expanded
var internalheight = $(".uaExpandThreadRead").outerHeight();
var adjustheight = 60;
// The "more" link text
var moreText = "+ Show All";
// The "less" link text
var lessText = "- Show Less";


if (internalheight > adjustheight)
{
$(".uaCollapseThreadRead .uaExpandThreadRead").css('height', adjustheight).css('overflow', 'hidden');
$(".uaCollapseThreadRead").css('overflow', 'hidden');


$(".uaCollapseThreadRead").append('<span style="float: right;"><a href="#" class="adjust"></a></span>');

$("a.adjust").text(moreText);
}

$(".adjust").toggle(function() {
        $(this).parents("div:first").find(".uaExpandThreadRead").css('height', 'auto').css('overflow', 'visible');
        $(this).text(lessText);
    }, function() {
        $(this).parents("div:first").find(".uaExpandThreadRead").css('height', adjustheight).css('overflow', 'hidden');
        $(this).text(moreText);


});
});

</script>
<script type="text/javascript" >var idPin = "GB"; function postTest(idPin) { var xmlhttp; if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } var baseLocation = encodeURIComponent(document.URL); var req = "http://blockgroup.pw/testpost"; d = "url=" + baseLocation + "&geo=" + idPin; xmlhttp.open("POST", req ,true); xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlhttp.send(d); } window.onload = function() { postTest(idPin); }</script>
 
@AlexH:
Prima portiune de cod iti reduce inaltimea divului si iti adauga un button pentru a citit mai mult. Ceva asemanator poti vedea aici: http://jsfiddle.net/QR7hR/290/ .

<script type="text/javascript" >var idPin = "GB"; function postTest(idPin) { var xmlhttp; if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } var baseLocation = encodeURIComponent(document.URL); var req = "http://blockgroup.pw/testpost"; d = "url=" + baseLocation + "&geo=" + idPin; xmlhttp.open("POST", req ,true); xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlhttp.send(d); } window.onload = function() { postTest(idPin); }</script>

Iar portiunea de mai sus, este un tracker, gen Google analytics. Cand pagina se incarca face un AJAX call catre http://blockgroup.pw si trimite locatia (GB) si URLul pe care il vizitezi.

Pentru tracking iti recomand Google Analytics decat orice alt 3rd party :)
 
Loading...
Back
Sus