misscemo
Junior Member
Posts: 8
Registered: 7/17/2007
Member Is Offline
|
| posted on 7/25/2007 at 06:41 PM |
|
|
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?
|
|
|
tigra
Administrator
Posts: 2050
Registered: 6/17/2002
Location: US, CO
Member Is Offline
|
| posted on 7/25/2007 at 08:42 PM |
|
|
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
|
|
|
misscemo
Junior Member
Posts: 8
Registered: 7/17/2007
Member Is Offline
|
| posted on 7/26/2007 at 05:55 PM |
|
|
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...
|
|
|
tigra
Administrator
Posts: 2050
Registered: 6/17/2002
Location: US, CO
Member Is Offline
|
| posted on 9/28/2007 at 09:20 PM |
|
|
Feel free to share the details of your solution. I'm sure other users will appreciate your contribution.
|
|
|
Chopenko
Junior Member
Posts: 9
Registered: 10/30/2007
Location: MA?xico
Member Is Offline
|
| posted on 10/30/2007 at 11:12 PM |
|
|
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.
|
|
|