Dynamically generating Javascript

  • Thread starter Fernando Chilvarguer
  • 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
 
B

bruce barker \(sqlwork.com\)

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

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top