View Full Version : pop up window talking to page!! anyone?

12-20-2007, 10:45 PM
I have asked this question a while back but i did not get a clear answer, maybe because my explanation wasnt that great, i will try again!!

I have a color picker that i have created (somewhat), it is almost completely in CSS. I have been trying to make one out of css for a while, although i do have about 20 lines of JS.

When you go to the page you have 4 DIV's, then below that is a link to the color picker...

Once clicked the window pops up, thus having to pages..

Here is the problem, how do i get that page that pops up, to talk to the page with the divs. Here is my javascript which is on the color picker page:

Array.prototype.filter = function(f /*, context*/) {
for(var r = [], i = 0, n = this.length, t = arguments[1], v; i < n; ++i)
if(f.call(t, v = this[i], i, this))
return r;

Array.prototype.forEach = function(f /*, context*/) {
for(var i = 0, n = this.length, t = arguments[1]; i < n; ++i)
f.call(t, this[i], i, this);

function changeClass(toClass) {
Array.prototype.filter.call(document.getElementsByTagName("div"), function(el) {
return /style\d+/.test(el.className);
}).forEach(function(el) {
el.className = toClass;

now what that does, thanks to Trinithis, changes out the classes.

How do i get the seperate pages to talk to each other.. If this is confusing im sorry, but if anyone can help me i would muchly appreciate it...