So like in title, i have some problems with form Flask (1.1.2) I tried to clear value of form by clicking button "Publish" but I don’t know why script is not executing on click. Java Script is well implemented <script type=text/javascript src="{{ url_for(‘static’, filename=’js/main.js’) }}"></script> But button with argument ‘onClick’ isn’t executing the function ‘clear()’ ..

Read more

I try to mapping nested JSON in React JS. My JSON data like this, "beautifuldata": [ { "id":"1", "name":"a"}, { "id":"2", "name":"b"}, { "id":"3", "name":"c"}, { "id":"4", "name":"d"}, { "id":"5", "name":"e"}, { "id":"6", "name":"f"}, { "id":"7", "name":"g"}] this data came from an API. And I can write my data to the console. But everything went ..

Read more

<button class="middiv-btn" onclick="var itemname=prompt(‘Item Name:’); var node = document.createElement(‘li’);node.appendChild(document.createTextNode(itemname)); document.querySelector(‘ul’).appendChild(node); var ol=document.createElement(‘ol’); var addtop=document.createElement(‘button’); addtop.onclick=’var itemname=prompt(‘Side Name:’);’; document.querySelector(‘ol’).appendChild(addtop)">Add an item +</button> This is my code block. The onclick attribute is the problem. I added an attribute to the addtop button element I made. In the onclick attribute, it says I need a semicolon in the ..

Read more

I have a html/javascript client that is listening to a mjpeg video stream: myImg = document.getElementById(‘my-image’); myImg.src = ‘http://myserver.com/camera.mjpeg’; Works fine but if the video stream dies for whatever reason the video feed "freezes" on the last received image and I have no opportunity to display an error to the user. I’ve see this post ..

Read more

I am trying to add external JS file to my Django project. Unfortunately it doesn’t work while I am trying to add it in many ways: In my template.html I have specified direct path: {% load static %} < script> src="{% static ‘commerce/static/js/test.js’ %}" < /script> it doesn’t work. My settings.py file: BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(file))) ..

Read more

I want to add plugins to grapesjs but I have no clue how to do it. I’ve tried pasting the view in browser code in index.html but that doesn’t seem to work. href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet" /> <script src="https://unpkg.com/grapesjs"></script> <script src="path/to/grapesjs-blocks-basic.min.js"></script> <div id="gjs"></div> <script type="text/javascript"> var editor = grapesjs.init({ fromElement: 1, container: "#gjs", plugins: ["gjs-blocks-basic"], pluginsOpts: { ..

Read more