A few days ago I start thinking about a new way to control our web site window size.In our site there is a main window which hold the most important data. For editing the data or view more data: you can choose your subject in the menu and it will open a new page with the full details.
The common sense says that the window should set its own width/height for best fit, with minimum scrolling, but the reality isn't that simple because this page can open either as a regular window or as a modal window and the parameters are different. There is another problem, changing the window size in run-time (in the body) is very ugly (you can see the window re-sizing itself).The other way is working with JavaScript file which holds the windows parameters and the opener will use this parameters for opening the wanted page. The good thing in this idea is that the menu will know all the sizes and open the windows in the wanted size (the one defined at the JS file). But here we have another problem that Server files (.cs) that writing JavaScript (from server) should know this JS file and the names of the parameters, can cause broken links. also, links to my site that sent via email won't open in the wanted size.
another idea is to use XML for server and at the first time (application) create dynamically the JS file with the parameters, still can cause broken links from (html or other JS) and this can cause a strange problem because we are connecting our files to JS file that is not created yet, I know it will work because it is happening on run-time, but it is still strange. In here we still have the problem for links to my site that sent via mail.
For the mail issue, lets say that every link should go first to my main page, and only their the main window will open the wanted page for you, so we can set the window size via the main window.
I am searching for other implementations to the JavaScript file that holds the sizes for all windows.Is there a better way for doing this?
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.