Add type="button"
to the button.
<button name="data" type="button" onclick="getData()">Click</button>
The default value of type
for a button is submit
, which self posts the form in your case and makes it look like a refresh.
More Related Contents:
- How to add a black shadow on top of a div block with background image?
- Javascript / Html Check box error [closed]
- Creating a textarea with auto-resize
- In what situations would AJAX long/short polling be preferred over HTML5 WebSockets?
- Document.write clears page
- HTML button to NOT submit form
- Submit multiple forms with one submit button
- How to load all the images from one of my folder into my web page, using Jquery/Javascript
- How to get the position of text within an element?
- \u200b (Zero width space) characters in my JS code. Where did they come from?
- replace innerHTML in contenteditable div
- Shrink DIV to text that’s wrapped to its max-width?
- Changing the type in IE with JavaScript
- How to clear a chart from a canvas so that hover events cannot be triggered?
- How to remove the parent element using plain Javascript
- Why scripts at the end of body tag
- Choosing Mobile Web HTML5 Framework [closed]
- How to read line by line of a text area HTML tag
- JavaScript innerHTML is not working for IE?
- How to pass variable value between different html pages in javascript
- Get all elements in the body tag using pure javascript
- Force page zoom at 100% with JS
- How do I detect when a web page is loaded?
- collapse and expand tabs jquery / simple accordion
- Simple HTML sanitizer in Javascript [closed]
- Dynamically Trigger HTML5 Cache Manifest file?
- Google Maps API v3 Highlight Country Border without using Polygons
- How to keep elements non-refreshed
- jQuery selector to target any class name (of multiple present) starting with a prefix?
- How to get a leaflet map canvas to have a 100% height?