views:

30

answers:

2

Hi,

is there a "document" property named ssh? It's a simple question. I've seen this in some code at work, but no one in the office wrote the code, so I'm stucked.

The line was document.ssh.firstPing(...)

firstPing was a method in the code, that is writen in js+php. But I've searched with eclipse throughout all the code and there is no ssh anywhere.

+2  A: 

There's no standard ssh property on the document object in the Javascript DOM bindings. If you're loading Javascript libraries, they could always add one (one can add properties to document if one likes). For instance, this is perfectly valid:

document.foo = {
    bar: function() {
        alert("Hi there!");
    }
};

document.foo.bar(); // alerts "Hi there"

More on the standard bindings here.

T.J. Crowder
A: 

ssh has to have been defined in some script somewhere. Since your codebase is partially PHP it may be a generated script and that's why it's not showing up obviously.

A technique you might try is open your page in FireFox with Firebug and analyze the list of scripts it shows to have loaded (under the scripts tab). The advantage here is that Firebug shows you eval scripts, not just the static script files. Firebug also lets you search through these. Then you may be able to backtrack from there into where it's being defined based on phrases.

Wyatt