locked
Update Function Jquery RRS feed

  • Question

  • User1421620300 posted

    Hello would it be possible for you to help me with adding additional functionality to my Jquery script? Right now i am confused about how to choose which button edit button  or how should i complete this function from my script. Whenever oi click on my edit button i receive the following errors!.. But altogether my script has an error because i am just trying to learn the basics.  but i have most of the code if it helps any. I have added new code to GitHub. Please reply! Markus33

    404 not found

    Endpoint Not Found 

    Inspector Console:

    VM1965:1 PUT http://localhost:53472/Service/SuperHeroService.svc/editHero 404 (Not Found)
    (anonymous) @ VM1965:1
    send @ jquery-3.1.1.min.js:4
    ajax @ jquery-3.1.1.min.js:4
    editHero @ service.js:45
    onclick @ index.html:1

    SuperHeroDB/Scripts/service.js

    https://github.com/Andrew112/SuperHeroDB

    Friday, March 6, 2020 4:23 PM

Answers

  • User-775646050 posted

    You are receiving a 404 which means whatever you are trying to call does not exist. Check that your route is correct. Use the network tab on your browser dev tools to view the request URL.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, March 6, 2020 6:55 PM
  • User1535942433 posted

    Hi Markus33,

    Accroding to your description,as far as I think,In your Service/SuperHeroService.svc , you could have to create a custom type containing a name value pair and the parameter of the page method will be an array of that custom type. Besides,I suggest you could press F12 and click the error,you will find the details of your problems.

    More details,you could refer to below codes:

    public SuperHero editHero(string heroId)
            {
    
            }

    More details,you could refer to below article:

    https://stackoverflow.com/questions/19663082/submit-form-details-using-ajax-tp-aspx-page

    Best regards,

    Yijing Sun

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 9, 2020 8:59 AM

All replies

  • User-775646050 posted

    You are receiving a 404 which means whatever you are trying to call does not exist. Check that your route is correct. Use the network tab on your browser dev tools to view the request URL.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, March 6, 2020 6:55 PM
  • User1535942433 posted

    Hi Markus33,

    Accroding to your description,as far as I think,In your Service/SuperHeroService.svc , you could have to create a custom type containing a name value pair and the parameter of the page method will be an array of that custom type. Besides,I suggest you could press F12 and click the error,you will find the details of your problems.

    More details,you could refer to below codes:

    public SuperHero editHero(string heroId)
            {
    
            }

    More details,you could refer to below article:

    https://stackoverflow.com/questions/19663082/submit-form-details-using-ajax-tp-aspx-page

    Best regards,

    Yijing Sun

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 9, 2020 8:59 AM