You cannot, because the parameter of your function is not defined. You also need some code to calculate the value of
DocURL
, but this code cannot have any input parameters just because the
onload
handler does not have any parameters.
I suspect you need something different. This function can be called with some default parameter on load, and called from somewhere else, like menu handler, with all the parameters.
Another problem is hard-coded URLs. Do you know this principle, one of the most important in all practical programming:
http://en.wikipedia.org/wiki/Don%27t_repeat_yourself[
^]?
You could would require typing the some URLs elsewhere, which is no less but a support nightmare. You need to centralize all UTLs and associated data and code (handlers, messages you show) in one single object, the way no value would be repeated. This is just one of possible approaches.
—SA