Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: calendar.html one level down in a subdirectory
Lila
Junior Member

Posts: 5
Registered: 8/31/2002
Member Is Offline
posted on 8/31/2002 at 11:52 PM Reply With Quote
calendar.html one level down in a subdirectory


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

test.htm calls calendar.html in the ..\subdirectory\calendar.html

test.htm
subdirectory
calendar.html
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 9/3/2002 at 07:36 AM Reply With Quote

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.
View User's Profile View All Posts By User U2U Member
Lila
Junior Member

Posts: 5
Registered: 8/31/2002
Member Is Offline
posted on 9/3/2002 at 11:03 PM Reply With Quote

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, ......
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 9/4/2002 at 08:05 AM Reply With Quote

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, ......
View User's Profile View All Posts By User U2U Member
Lila
Junior Member

Posts: 5
Registered: 8/31/2002
Member Is Offline
posted on 9/4/2002 at 09:10 AM Reply With Quote

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
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 9/5/2002 at 02:15 PM Reply With Quote

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.
View User's Profile View All Posts By User U2U Member
Lila
Junior Member

Posts: 5
Registered: 8/31/2002
Member Is Offline
posted on 9/8/2002 at 01:53 AM Reply With Quote

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
View User's Profile View All Posts By User U2U Member
Lila
Junior Member

Posts: 5
Registered: 8/31/2002
Member Is Offline
posted on 9/8/2002 at 11:23 AM Reply With Quote

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
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Live Demos
Free Download Free Download
Product Documentation Documentation
Support Forum Support Forum
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004