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: Partial Solution
Chopenko
Junior Member

Posts: 9
Registered: 10/30/2007
Location: MA?xico
Member Is Offline
posted on 10/30/2007 at 11:09 PM Reply With Quote
Partial Solution


I found this works, though slow, I think it's because it has to resolve the DNS first.

The calendar takes more time to popup.
The code is taken from IE 404 Page.

-----------------------------------------------------------------------------

//For testing use
//DocURL= "res://shdocvw.dll/http_404.htm#https://www.microsoft.com/bar.htm"

DocURL=document.location.href;

//this is where the http or https will be, as found by searching for :// but skipping the res://

protocolIndex=DocURL.indexOf("://", 4);

//this finds the ending slash for the domain server

serverIndex=DocURL.indexOf("/", protocolIndex + 3);

//for the href, we need a valid URL to the domain. We search for the # symbol to find the begining
//of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.
//urlresult=DocURL.substring(protocolIndex - 4,serverIndex);

BeginURL=DocURL.indexOf("#",1) + 1;
urlresult=DocURL.substring(BeginURL, serverIndex);
if (protocolIndex - BeginURL > 7)
urlresult=""

//for display, we need to skip after http://, and go to the next slash

displayresult=DocURL.substring(protocolIndex + 3, serverIndex);


var obj_calwindow = window.open('http://'+displayresult+'/CMSG/Calendar/calendar.html?id='...

-----------------------------------------------------------------------------

As you can see, it's by using absolute path.
View User's Profile View All Posts By User U2U Member
bmn
Junior Member

Posts: 2
Registered: 8/22/2007
Member Is Offline
posted on 1/9/2008 at 08:57 PM Reply With Quote
Better solution


Actually, it is easier this way:

The popup is called from 'calendar.html' on line 98 - obj_caller.popup(dt_datetime.valueOf());
So u can rename it to for example obj_caller.popup2 and
in calendar?.js make popup2 function exactly the same as popup1,
just change the address to one which is ok for calendar.html.
finally, don't forget to assign it in the beginning of the js file: this.popup2 = cal_popup2;

that way there are 2 popup functions, one called first time from your page and the
other called from calendar.html

of course it's a lousy solution, it would be better to make a decision which address to use
by a parameter in the popup function, but who cares...
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 1/10/2008 at 12:32 AM Reply With Quote

and then there's good old absolute path that works from everywhere and doesn't involve tricky server setup.

/js/calendar.html
or
http://www.domain.com/js/calendar.html
View User's Profile View All Posts By User U2U Member
Chopenko
Junior Member

Posts: 9
Registered: 10/30/2007
Location: MA?xico
Member Is Offline
posted on 1/10/2008 at 02:10 AM Reply With Quote

Quote:
Originally posted by tigra
and then there's good old absolute path that works from everywhere and doesn't involve tricky server setup.

/js/calendar.html
or
http://www.domain.com/js/calendar.html


Hi Tigra, thanks for the calendar, it's just simple and fast, I like it so much.

I even modified a little bit the script to make a simple Day selector, so when I picked a Day, the script would return and write two fields, one with 01/01/08 00:00:00 and another with 01/01/08 23:59:59.

Yeah, I know it's better to use that method, but since I was working on my local apache Sever I didn't wanted to edit anything when I finished the project. The project was for another person and that person was in charge of uploading and maintaining the online server.
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