Dynamically generating Javascript

  • Thread starter Thread starter Fernando Chilvarguer
  • Start date Start date
F

Fernando Chilvarguer

Here's my scenario:

I have one page, one control, and I want the control to generate a
javascript to the page based on parameters passed by the queryString.

ASPX Code:
....
<head>
<title>TItle</title>

<uc1:MyControl ID="myControl1" runat="server" />

<script type="text/javascript">
function function2(id,myText){
document.getElementById(id).innerHTML=myText
}

function function3(id,myText){
document.getElementById(id).innerHTML=function1(myText)
}
</script>
....

The output of "myControl1" is the javascript called "function1", which is
called by function3

But for some reason it does not work, I get the "Object expected" error in
javascript (can't find function1).
I'm assuming it has to do with the page life-cycle but I have no idea.
Any help will be very appreciated.

Thanks,
Fernando
 
look at the page source. also check that the ids passed to functions match
the rendered ids.

-- bruce (sqlwork.com)
 
Back
Top