Populate a dropdown (javascript) on load of page

Populate a dropdown (javascript) on load of page

  
Hello everybody, 
 
I am creating an application with jquery and I wanted to load a dropdown 
with records from a table in the database and wanted this dropdown 
was born early in the loading screen. 
 
I wonder if it is possible to communicate with the javascript in the onload 
page, filling the dropdown with information from the database? 
 
Example:
<select id="field_0" class="other" name="field_0" size="1">
<option></option>
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
</select> 
 
Note: 
What is bold would be the data coming from database.
 
Thanks, 
 
Ricardo Palhares.
Hi Richard,

You can acomplish this with:

1) Some "no escape" expression with something like this:
"
$(document).ready(function() {"
+SomeFunctionHereThatBindsTheNecessaryJavaScriptCodeToAcomplishYourTask()+
"
});
"

OR

2)  Using the shared action RunJavascript from the extension RichWidgetsExtension you are able to execute javascript on your Preparation

Regards,
Rafael Pereira
Hi Rafael,

I opted for the tip number two, did not know there was such an extension.
I tested my application and solved my problem.

Thank you!

Ricardo Palhares
Happy to help you!