|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I want to replace <body onLoad="scaleWidth(240,450,500)" onResize="scaleWidth(240,450,500)"> with an XHTML 1.0 strict alternative.
I've already tried adding: window.onload = scaleWidth; window.onresize = scaleWidth; to my external file. There were two problems with this "solution." First, the function was called when the page first loaded but not when it was resized (only checked in IE6). Second, I can't pass arguments from my XHTML page this way. I want to be able to pass arguments because I want to use this function in a template, with the arguments passed changing with the particular page the template creates. Any ideas? -- Chris |
|
#2
|
|||
|
|||
|
I got a reply to the same question on another forum. Here is the solution:
Place the following on the XHTML page: <script type="text/javascript"> onload = onresize = function() { scaleWidth(240,450,500); } </script> -- Chris |
|
#3
|
||||
|
||||
|
Whoa - I would never have tried that... looks very odd. Thanks for posting the reply.
|
|
#4
|
||||
|
||||
|
Wow, does that work?
I've never seen that type of syntax for js before! ya learn something every day i guess [and ya, i'm too lazy to try it out myself right now] |
|
#5
|
|||
|
|||
|
Yes, it works! (NT)
No text . . .
|
|
#6
|
||||
|
||||
|
heh, crazy...
i think we all learnt something today =) (well, we all being at least me, myself and i) |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > How to call and pass arguments to JS functions in external files w/o using body tag? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|