WordPress ajax function runs on front end when not called
I have a page that displays an archive of a custom post type and there is a real time search field. The page should load with a default set of results, then on keyup in the search field will filter out results based on the post title, and if the field is cleared just show all like when the page initially loads.
After refresh my page, my css is no longer applied , how to store the script
I am trying to generate a list of pages with AJAX when I click on the button. When i click on the button it works , I have a new row added with the CSS I created. But when I refresh the page, the row is no longer exist ( tr, td..) I just have the data but not the table and the buttons actions don’t work anymore. But when I click on the button, the row is well added like in the image :
generate list in table
WordPress : Store a data in the back so and in JS to remove this if deleted
I have an issue to understand how to proceed. I Created a image button and when I will click on it , the pages generated will be displayed. The problem is that when I am going to the dashboard of wordpress and delete a post, it will stay in the generated pages (with ajax); It is because I use LocalStorage and I should delete in the back too. If I don’t use Local Storage when I reload the page, they disappear.