locked
Ajax not working RRS feed

  • Question

  • User1922541779 posted

    I need the simplest bare bone example of ajax in mvc app. I created mvc 5 app to experiment but I cannot make it work. I tried AJAX first and it turned out to create a nightmare. So I tried to run this simple alert from Javascript. I am getting warning   : 

    Index:1 The connection used to load resources from https://localhost:44309 used TLS 1.0 or TLS 1.1, which are deprecated and will be disabled in the future. Once disabled, users will be prevented from loading these resources. The server should enable TLS 1.2 or later. See https://www.chromestatus.com/feature/5654791610957824 for more information.

    @{
        ViewBag.Title = "Index";
    }
    
    <h2>Index</h2>
    <a href="#" data-movieId="34" class="movie">Delete Avengers</a>
    <a href="#" data-movieId="35" class="movie">Delete Iron Man</a>
    
    <script type="text/javascript">
        (function () {
            let p = document.getElementsByClassName("movie");
            p.click(function(e){
           alert("hi");
              
        
       });
    });
    

    Saturday, September 21, 2019 11:10 PM

Answers

  • User1922541779 posted

    I  needed to  reference   jq and   jq unobstrutive

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 22, 2019 11:55 AM