Click to See Complete Forum and Search --> : url for floating window~


black
06-27-2003, 02:51 AM
guys i need your help here~

my code called a cute floating window and it kept bounce within its parent window, it worked perfect with its location property empty but refused move even one pace if location has any contents. here is my code:

function wMove()
{
if ((w_x + w_width + w_xd) >= screen.availWidth || (w_x + w_xd) <= 0)
{
w_xd = - w_xd;
}
if ((w_y + w_height + w_yd) >= screen.availHeight || (w_y + w_yd) <= 0)
{
w_yd = - w_yd;
}
w_x += w_xd;
w_y += w_yd;
w.moveTo(w_x, w_y);
}

var w_width = 100;
var w_height = 100;
var w_x = 0;
var w_y = 0;
var w_delay = 20;
var w_url = "http://www.webdeveloper.com";
var w_name = "floatingWindow";
var w_xd = 2;
var w_yd = 2;

var w = window.open(w_url, w_name, "width = " + w_width + ", height = " + w_height);
w.moveTo(w_x, w_y);
setInterval(wMove, w_delay);

the code only works when this line: var w = window.open(w_url, w_name, "width = " + w_width + ", height = " + w_height); is converted to something like this: var w = window.open("", w_name, "width = " + w_width + ", height = " + w_height);, what's up ??? :confused:

skriptor
06-27-2003, 03:12 AM
Hi,
use a url from your own side and it will work. If you use a foreign url you try to do some cross-site-scripting and this is forbidden by security.
Good luck, skriptor

black
06-27-2003, 03:22 AM
thanx but it doesnt work even if i fixed that url to domestic one...... :(

skriptor
06-27-2003, 05:03 AM
Hi,
at the moment I look to a floating window with content and I'm asking myself what could be wrong. With your first version I got an access denied error. Using the same website it works fine.
Good luck, skriptor