Refresh conent with JQuery/AJAX after using a MVC partial view

Posted by Aaron Salazar on Stack Overflow See other posts from Stack Overflow or by Aaron Salazar
Published on 2010-03-23T21:32:41Z Indexed on 2010/03/23 21:43 UTC
Read the original article Hit count: 992

Filed under:
|
|
|

Using the following JQuery/AJAX function I'm calling a partial view when an option is changed in a combobox named "ReportedIssue" that is also in the partial view. The is named "tableContent".

<script type="text/javascript">
    $(function() {
        $('#ReportedIssue')
      .change(function() {
          var styleValue = $(this).val();
          $('#tableContent').load(
          '/CurReport/TableResults',
          { style: styleValue }
        );
      })
      .change();
    });
</script>

My problem is that after the jump to the partial view I lose the link to the javascript. I think I'm supposed to use the JQuery ".live()" but I'm unsure.

In short, I want to re-establish the link between my JavaScript and my combobox and after the inclusion of the partial view's HTML.

I hope I'm being clear enough,

Aaron

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript