skip to Main Content

Javascript – How to send data from the drop-down list to the server?

I am developing a web application in Go. I have a drop-down list, it is formed from a template. <div class="dropdown"> <button onclick="myFunction()" class="dropbtn"> Удалить услугу</button> <ul id="myDropdown" class="dropdown-content"> {{range .}} <li>{{.Id}}</li> {{end}} </ul> </div> <script> function myFunction() { document.getElementById("myDropdown").classList.toggle("show");…

VIEW QUESTION

Json – API request – TypeError: string indices must be integers

I develop a simple API request. Here is the code: import requests import json #Get data result = requests.get("https://pkip.riga.lv/documentregistration/divisionregister?district_id=516&division_id=2863") divisions = json.loads(result.content) info_list = [] for info in divisions: info_list.append(info["valid_from"]) print (info_list) div_list = list(dict.fromkeys(info_list)) #Sort div_list.sort() #Print for info…

VIEW QUESTION
Back To Top
Search