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: window.open calendar.html
misscemo
Junior Member

Posts: 8
Registered: 7/17/2007
Member Is Offline
posted on 7/25/2007 at 06:41 PM Reply With Quote
window.open calendar.html


I tried this to see if calendar3.js was actually trying to open calendar.html using the relative path:

var obj_calwindow = window.open("../workstation/includes/calendar.html")

A calendar did pop up, but only with the functionality to pick a date within the current month - nothing more.

This being a problem, I decided to go back to the original code:

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

This code only opens a window the size specified for the calendar, but it holds the message 404 HTML File Not Found. I believe that something is incorrect in the code above - either some value is wrong or empty, but I am unsure how to tell what that problem may be... I work in Websphere. Can anyone help me?
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 7/25/2007 at 08:42 PM Reply With Quote

you need to use the absolute path in the window.open(...) call
it works first time then the current folder for calendar.html becomes ../workstation/includes/ and when same link called for that folder it attempts to get ../workstation/includes/../workstation/includes/
this doesn't happen with absolute paths
View User's Profile View All Posts By User U2U Member
misscemo
Junior Member

Posts: 8
Registered: 7/17/2007
Member Is Offline
posted on 7/26/2007 at 05:55 PM Reply With Quote

You were right about the path, but I found a way around it and I am still using the relative. When we move our product off the pc and onto a server, I want to be sure the code will still work...
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/28/2007 at 09:20 PM Reply With Quote

Feel free to share the details of your solution. I'm sure other users will appreciate your contribution.
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 10/30/2007 at 11:12 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
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