By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,289 Members | 1,447 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,289 IT Pros & Developers. It's quick & easy.

Executing JavaScript Code Within AJAX Response

P: 1
Is there a way to execute inline javascript code from within an AJAX response? I use AJAX to retrive a JSP page that is loaded using a database bean. One of the form elements is a select that I would like to set based on the database value. I've tried embedding inline script like:
Expand|Select|Wrap|Line Numbers
  1. <script language="javascript">
  2.   document.form1.state.value = "<bean value for state>";
  3. </script>
but the code doesn't seem to fire. Any suggestions?
Sep 18 '07 #1
Share this Question
Share on Google+
2 Replies


pbmods
Expert 5K+
P: 5,821
Heya, FrogBunz. Welcome to TSDN!

Please use CODE tags when posting source code:

[CODE=javascript]
JavaScript code goes here.
[/CODE]
Sep 18 '07 #2

dmjpro
100+
P: 2,476
Is there a way to execute inline javascript code from within an AJAX response? I use AJAX to retrive a JSP page that is loaded using a database bean. One of the form elements is a select that I would like to set based on the database value. I've tried embedding inline script like:
Expand|Select|Wrap|Line Numbers
  1. <script language="javascript">
  2.   document.form1.state.value = "<bean value for state>";
  3. </script>
but the code doesn't seem to fire. Any suggestions?
Welcome to TSDN! :)
AJAX = > Asynchronous JavaScript & XML.
If the response is XML then simply parse the desired value and put at in your desired position in your Page.
If it is a Text den substring that Text and put it.

Kind regards,
Dmjpro.
Sep 19 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.