View Single Post
Old Sep 25th, 2007, 9:17 PM   #8
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Have your code behind file generate a call in the HTML. Generally, I put it before the </body> tag, but I might put it in on "on_init" function, if it's called for.

For the first option, just emit, as HTML,
<script type="text/javascript">
    showDiv ();
</script>
</body>

The browser has no idea of what you are doing on the server. When you write your code with a mixture of asp (or PHP, or anything else) and HTML, that is not an interactive scenario where the server does something and the browser does something and the server does something, and so on.

That is merely building the page, part of it with textual HTML, and part of it with the server program (asp, or whatever) emitting HTML. When the page is built, it is sent. The browser looks at that page and renders it.

If you wonder what the hell your browser is actually seeing, then just view source. That won't necessarily give you everything (the contents of files that you load with style or external script inclusions), but if you really need to see those at the client (you can see them on the server, since you wrote them), then read the RFC's and write a program that loads them just like the browser does.

EDIT: That won't work any better, wizard, because the page would still have to call "somefunction".
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote