Reputation: 13
<script type="text/javascript">
function DoThings()
{
var txt = txtbox.value;
txt = /* passed info from code behind */
}
$(function() { var Tags=[ txt ]; $( "txtbox2").autocomplete({source: Tags});});
</script>
but i want to move it to the page. im unsure how i send the variable "txt" to my jquery function
Upvotes: 0
Views: 121
Reputation: 160973
Make the function have a return statement.
function DoThings() {
var txt = txtbox.value;
txt = /* passed info from code behind */
return txt; //return it.
}
$(function() {
var Tags=[DoThings()]; $("#txtbox2").autocomplete({source: Tags});});
Upvotes: 1