开发者

what is top.passback() in Javascript

I'm dealing with some old @ss legacy code that was written 3 or 4 developers ago..开发者_如何转开发.. Apparently there is some unfinished code and I'm getting errors that passback is not a valid function.

The line in question is: top.passBack('curCtrl', r + "," + g + "," + b);

I've done some research and I couldn't find any reference to a javascript function called passBack. I searched the project and couldn't find any references to custom function called passBack either.

Was passBack used a long time ago and has it been depreciated? I've seen that .opener comes up when I search for passBack. I tried the examples in opener but it says that it returns NULL... This project is a little hokey when it comes to popups and screens. Everything is done through a component (no separation).

Any ideas?


The top property of the window object refers to the topmost window in a hierarchy (a parent-child chain). It's generally used when you've got frames or iframes.

Thus there's probably some global function passBack on the parent window, or at least the code expects there to be.

Here is the MDN page about window.top. All browsers I know of support it the same way.


At a guess "passBack" sounds like code that controls communication between the main browser window and any popups that it has opened. With the names of variables "r" "g" "b" as parameters it sounds like it's setting a color somewhere.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜