<p>I am working on a web page that is using jQuery. I have an Ajax call that gets data from the server and updates a div. Inside that data there is a jQuery function, but the function is not being called after the data is loaded into the page. I have the proper js files included in the page already.</p>

<p>This is what is returned from the Ajax call and placed into a div:</p>

<pre><code>&lt;script type="text/javascript"&gt;
    $(function() {
         $('input').myFunction('param');             
    }); 
&lt;/script&gt;
&lt;p&gt; other html &lt;/p&gt;
</code></pre>

<p>How do I get the returned javascript to run after the html is inserted into the page?</p>

<p>(I am using Rails with the jRails plugin )</p>

If you want JavaScript tag evaluation, with html content, you should set the dataType option of the ajax call to "html":
```
```
$.ajax({
  type: "GET",
  url: "yourPage.htm",
  dataType: "html"
});
```
```
Or dataType "script", if you want to load and execute a .js file:
```
```
$.ajax({
  type: "GET",
  url: "test.js",
  dataType: "script"
});
```
```
more info here:
Ajax/jQuery.ajax