One for the gurus

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alvin Bruney

    #1

    One for the gurus

    Anybody know how to call a javascript function from server side code?

    This isn't as simple as it sounds really. I need to call the script after
    the handler has executed which rules out attributes completely. Streaming it
    via the output stream doesn't seem to work for objects or functions that
    aren't part of the IE model (my local script functions for example).

    My problem is i'm populating a client side control by streaming out data
    from the server. What i have is kinda cheese. Once i stream the data, it
    sits in the page and then i pop a client side control to click on. I use the
    client side click event to load the control. I'd like to eliminate the last
    step and just pull the data, put it in the page and force the control to
    load the data all in one step.

    Thanks in advance


  • Chris Hornberger

    #2
    Re: One for the gurus

    Exactly. Just don't wrap it in a function and it will execute at
    page-render time. Like...

    <script language="javas cript">
    document.locati on.href='http://www.yahoo.com';
    </script>


    "gcl" <lnguyen59@comc ast.net> wrote in message news:<009001c34 d5b$1f6ce9e0$a6 01280a@phx.gbl> ...[color=blue]
    > I think u can execute it while the page is loading
    > by embedding <script> blah blanh </script>
    > in the body block
    >
    >
    >
    >
    >[color=green]
    > >-----Original Message-----
    > >Anybody know how to call a javascript function from[/color]
    > server side code?[color=green]
    > >
    > >This isn't as simple as it sounds really. I need to call[/color]
    > the script after[color=green]
    > >the handler has executed which rules out attributes[/color]
    > completely. Streaming it[color=green]
    > >via the output stream doesn't seem to work for objects[/color]
    > or functions that[color=green]
    > >aren't part of the IE model (my local script functions[/color]
    > for example).[color=green]
    > >
    > >My problem is i'm populating a client side control by[/color]
    > streaming out data[color=green]
    > >from the server. What i have is kinda cheese. Once i[/color]
    > stream the data, it[color=green]
    > >sits in the page and then i pop a client side control to[/color]
    > click on. I use the[color=green]
    > >client side click event to load the control. I'd like to[/color]
    > eliminate the last[color=green]
    > >step and just pull the data, put it in the page and[/color]
    > force the control to[color=green]
    > >load the data all in one step.
    > >
    > >Thanks in advance
    > >
    > >
    > >.
    > >[/color][/color]

    Comment

    Working...