Rought Interpretation

Discussion in 'HTML & JavaScript' started by drumltd, May 21, 2011.

  1. drumltd

    drumltd Regular Member

    Dec 4, 2008
    Likes Received:
    As a PHP programmer, can anybody give me a rough brief on what this does

    var l = g.location,
    host = l.hostname,
    path = l.pathname,
    a = l.href.replace("#%21","#!");


    g.location.hash = "";
    g.location="https://" + host + a.replace(/^([^\/])/,"/$1");
    } else {
    g.location="https://" + host + path +;

    My PHP code is getting this return about 1 in 5 times from a site I'm interfacing with, run exactly the same query in Firefox it works fine, but from PHP, the other 4/5 times it works just fine. I suspect the site is try to test wether I can run javascript. So what do I need to do to trick it?

    Is $1 an actual variable or does it actually add "$1" to the url??