0

I'm trying to make a jquery ajax request to an html page that passes in a parameter value called "action". In this html page, I want to only show certain div elements depending on the value of the parameter action.

Here is the html I am trying to return from the ajax call that sends in the parameter "action" in Information.html file:

<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body ng-app="">

    <div id="" ng-show="param.action==INFORMACC">
        <span class="parent candidate donedate"></span>
        <p class="center bold">Informal Acceptance</p>
        <ul>
            <li> The Division Coordinator</li>
        </ul>
    </div>

    <div id="" ng-show="param.action==SEARCHSUM">
        <span class=" hr donedate"></span>
        <span>
            <p class="center bold">Search & Summary Approved</p>
            <ul class="bullet" style="list-style:disc; ">
                <li style="list-style:disc; list-style-   position:inside;">Affirmative</li>
            </ul>
        </span>
    </div>

</body>
</html>

Here is the ajax request in demo.js file:

    function getInfo(action) {
        var recruitment_id =$('#personselect').val() ;

        var request = $.ajax({
                type: "GET",
                url: "Information.html",
                cache:false,
                data: {action: action , p_recruitment_id : recruitment_id} 
         });
         request.done(function(msg) {
            $("#dialog-message").children("p:first").html(msg);
         });

    };
  • can you specify what is the behavior your getting or any error on console? – Aarati Mar 22 '17 at 15:29
  • Maybe this can help you http://stackoverflow.com/questions/42749029/ng-bind-html-doesnt-work-with-script/42749319#42749319 I guess that you want the **msg** work with angular. – blackmiaool Mar 22 '17 at 15:29
  • I'm not getting an error, it's returning both div elements. @Aarati – sambodino Mar 22 '17 at 15:31
  • most likely ajax call returns HTML as a response without angular module being initialized , basically angular life cycle is not properly triggered as html is not being executed inside web browser, – Aarati Mar 22 '17 at 16:46

0 Answers0