Problem calling dynamic javascript function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using remote scripting to call a .NET page within a main page. The
child page (child.aspx) returns html that contains dynamically created
javascript methods (function test()).

The parent page sets a document item's innerHTML property to the result of
the child page. This all works fine, except that the parent page also makes
a call to the "test()" method that is contained within that innerHTML. The
call is made after the innerHTML results are returned, yet a javascript error
occurs stating that the call to "test()" is an invalid object.

It is obvious that for some reason the parent window's javascript is not
recognizing the function definition that was returned by the child page. How
can I get this method to be recognized?
 
copying innerHtml does not copy the script blocks, as the parsed html does
not contain any javascript (except for in attributes like onclick).

you will need to copy the script block, or call the method off the child
frame


-- 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

Back
Top