The second argument to addEventListener
should be a function. You’re not passing a function, you’re calling the function immediately and passing the result. Change to:
document.getElementById("showF").addEventListener("click", function() {
sacardatos('P1.txt','container');
}, false);
Related Contents:
- How to send FormData objects with Ajax-requests in jQuery? [duplicate]
- Scroll to bottom of div?
- Submit form without page reloading
- In what situations would AJAX long/short polling be preferred over HTML5 WebSockets?
- Executing injected by innerHTML after AJAX call
- How to communicate between iframe and the parent site?
- load scripts asynchronously
- Changing CSS Values with Javascript
- Refresh/reload the content in Div using jquery/ajax
- Set timeout for ajax (jQuery)
- Prevent Page Load on Jquery Form Submit with None Display Button
- Using HTML5 file uploads with AJAX and jQuery
- Why is it a bad practice to return generated HTML instead of JSON? Or is it?
- Replace HTML page with contents retrieved via AJAX
- “Mixed content blocked” when running an HTTP AJAX operation in an HTTPS page
- How to bind Events on Ajax loaded Content?
- Will HTML5 allow web apps to make peer-to-peer HTTP connections?
- get the data of uploaded file in javascript
- jquery submit form and then show results in an existing div
- Want HTML form submit to do nothing
- Refresh a Div that has a Google ad inside it
- How does facebook rewrite the source URL of a page in the browser address bar?
- how to assign javascript variable value to php variable [duplicate]
- Javascript regex returning true.. then false.. then true.. etc [duplicate]
- When loading an html page via ajax, will script tags be loaded?
- How do I abort image load requests without using window.stop()
- Get HTML code using JavaScript with a URL
- Prevent page reload and redirect on form submit ajax/jquery
- history.replaceState() example?
- How to replace html element with ajax response?
- Execute a python script on button click
- Cross domain Ajax request from within js file
- how to use jQuery ajax calls with node.js
- Drag-and-drop file upload in Google Chrome/Chromium and Safari?
- Which “href” value should I use for JavaScript links, “#” or “javascript:void(0)”?
- How to manage a redirect request after a jQuery Ajax call
- How to resolve the C:\fakepath?
- How to get a file or blob from an object URL?
- How to impose maxlength on textArea in HTML using JavaScript
- Why am I seeing an “origin is not allowed by Access-Control-Allow-Origin” error here? [duplicate]
- Origin is not allowed by Access-Control-Allow-Origin
- getCurrentPosition() and watchPosition() are deprecated on insecure origins
- Is there a DOM event that fires when an HTML select element is closed?
- google maps move marker with lat/lng from ajax success returned data
- How does GitHub change the URL but not the reload? [duplicate]
- Javascript Code works in jsfiddle and but not in the Browser [closed]
- How to display selected image without sending data to server?
- AngularJS – placeholder for empty result from filter
- Disable zoom on input focus in Android webpage
- Can we use the value of localStorage from other domains?