Board Logo

calendar.html one level down in a subdirectory
Lila - 8/31/2002 at 11:52 PM

How can I move calendar.html one level down in the directory listing meaning

test.htm calls calendar.html in the ..subdirectorycalendar.html

test.htm
subdirectory
calendar.html


tigra - 9/3/2002 at 07:36 AM

when moving calendar.js from the file it is called from make sure you specify absolute path (the one starting with slash like /subdirectory/calendar.js) in window.open statement (file menu.js)

All calendar images should be referenced with absolute paths as well.


Lila - 9/3/2002 at 11:03 PM

it is not working


var obj_calwindow = window.open(
'calendar.html?datetime=' + this.dt_current.valueOf()+ '&id=' + this.id, ......

if a change in

var obj_calwindow = window.open(
'html/calendar.html?datetime=' + this.dt_current.valueOf()+ '&id=' + this.id, ......


tigra - 9/4/2002 at 08:05 AM

Again: make sure you specify absolute path (the one starting with slash).

Valid code for your case (if html is subdirectory of document root of your web server) would be:

var obj_calwindow = window.open(
'/html/calendar.html?datetime=' + this.dt_current.valueOf()+ '&id=' + this.id, ......


Lila - 9/4/2002 at 09:10 AM

with all respect

if html is subdirectory

'/html/calendar.html?datetime... is not working I have to remove the first slash
If I remove the first slash I'm able to call the current month, but clicking on the next/previous month/year icon results in not finding the html page.

.... what is wrong maybe its just me? Thanks


tigra - 9/5/2002 at 02:15 PM

Don't forget about note:
if html is subdirectory of document root of your web server

Ok, assume your page is at:
http://www.yourdomain.com/your_dir1/your_dir2/page.html

And calendar is located at:
http://www.yourdomain.com/your_dir1/your_dir2/html/page.html

In window.open statement you should specify:

/your_dir1/your_dir2/html/page.html

This is absolute path.


Lila - 9/8/2002 at 01:53 AM

problem solved : thank you

I integrated the following code:

function cal_popup1 (str_datetime) {
this.dt_current = this.prs_tsmp(str_datetime ? str_datetime : this.target.value);
if (!this.dt_current) return;


tmpString = strrev(unescape(location.pathname));
var i = 0;
for (i = 0; i < tmpString.length; i++)
if (tmpString.substring(i,i+1) == '\')
{
tmpString= strrev(tmpString.substring(i,tmpString.length));
break;
}


var obj_calwindow = window.open(tmpString+
'html/calendar.html?datetime=' + this.dt_current.valueOf()+ '&id=' + this.id,
'Calendar', 'width=200,height='+(this.time_comp ? 215 : 190)+
',status=no,resizable=no,top=200,left=200,dependent=yes,alwaysRaised=yes'
);
obj_calwindow.opener = window;
obj_calwindow.focus();
}



strrev = is just a string reverse function


Lila - 9/8/2002 at 11:23 AM

additional correction

change the condition to


if (tmpString.substring(i,i+1) == '\' || tmpString.substring(i,i+1) == '/' )

this keeps the NetScape users happy

I only tried this code local and not on a host server.
any comment or corrections welcome

Thanks && Greetings


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/