vansh110
04-18-2008, 10:55 PM
1) Script Title: dhtmlwindow.js
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/
3) Describe problem:
Hello,
I have the dhtmlwindow.js file set up to create dhtml pop ups. It works smooth for the most part. But there is a new functionality that requires me to call a javascript funciton when the user closes the dhtml pop - up. That is, I have to call a function when they click on the little X on top right. I am looking at the dhtmlwindow.js file and figured out the part where it calls the close function, it is around line #210 (approx.) and the code looks like this:
else if (/Close/i.test(sourceobj.getAttribute("title"))) //if this is the "close" control
{
d.close(this._parent)
}
Now the question I have is that I have to call a function everytime else if (/Close/i.test(sourceobj.getAttribute("title"))) is true. So the code has to look like this:
else if (/Close/i.test(sourceobj.getAttribute("title"))) //if this is the "close" control
{
d.close(this._parent)
my_function();
}
However, I have to have a condition around my_function() so that my_function() is called only for a certain dhtml pop-up and not for all pop ups.
On a html pop up, you could just do a window.document.href to get the source content of the pop up but this is a dhtml pop up and I cant seem to find the variable that will allow me to do a check on the href attribute to see what the content source of the pop up is.
This would be a great help indeed if you can point me in the right direction. thanks!
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/
3) Describe problem:
Hello,
I have the dhtmlwindow.js file set up to create dhtml pop ups. It works smooth for the most part. But there is a new functionality that requires me to call a javascript funciton when the user closes the dhtml pop - up. That is, I have to call a function when they click on the little X on top right. I am looking at the dhtmlwindow.js file and figured out the part where it calls the close function, it is around line #210 (approx.) and the code looks like this:
else if (/Close/i.test(sourceobj.getAttribute("title"))) //if this is the "close" control
{
d.close(this._parent)
}
Now the question I have is that I have to call a function everytime else if (/Close/i.test(sourceobj.getAttribute("title"))) is true. So the code has to look like this:
else if (/Close/i.test(sourceobj.getAttribute("title"))) //if this is the "close" control
{
d.close(this._parent)
my_function();
}
However, I have to have a condition around my_function() so that my_function() is called only for a certain dhtml pop-up and not for all pop ups.
On a html pop up, you could just do a window.document.href to get the source content of the pop up but this is a dhtml pop up and I cant seem to find the variable that will allow me to do a check on the href attribute to see what the content source of the pop up is.
This would be a great help indeed if you can point me in the right direction. thanks!