ajax

Spring MVC + Ajax JSON post

你离开我真会死。 提交于 2021-02-08 11:20:26
问题 I have a problem with send JSON to the Controller . I can't understand my problem. So, url - /notes/{username}/add Ajax : $.ajax({ type: "POST", contentType : 'application/json; charset=utf-8', dataType : 'json', url: window.location.pathname, data: JSON.stringify({ title: $("#title").val(), text: $("#text").val() }), success : function() { $("#title").val(""); $("#text").val(""); } }); Controller : @RequestMapping(value = "/{username}/add", method = POST) public void add(@RequestBody Note

AJAX call fired multiple times

北慕城南 提交于 2021-02-08 11:13:06
问题 I have a php application to upload excel files to server.I use ajax to send data to server.But some times the ajax call works repeatedly.I called the ajax function in button click as $(document).on("click", "#btnContinue", function() { $.ajax({ url: "ExcelColDesptn.php", data: data, type: 'post', success: function(response) {} }); HTML: <button id="btnContinue" name="btnContinue" class="btn btn-primary ">Continue </button> I use firebug to fix it, it shows I don't know why it happens. Here

How to Export to Excel a div content using Jquery?

风格不统一 提交于 2021-02-08 11:10:26
问题 I am trying to export div data which using Jquery. When i click Export To Excel button the file is downloading. but the value is single row only i need to split separate row. Example: FirstName Last Name NAMA VEENESH JS: $("#ExportToExcel").click(function (e) { let file = new Blob([$('#ExportDetails').html()], { type: "application/vnd.ms-excel" }); let url = URL.createObjectURL(file); let a = $("<a />", { href: url, download: "filename.xls" }).appendTo("body").get(0).click(); e.preventDefault

Uncaught TypeError: Cannot read property '0' of null - leaflet

若如初见. 提交于 2021-02-08 10:35:16
问题 I'm trying update my leaflet map via JS + AJAX, but leaflet return me an error Uncaught TypeError: Cannot read property '0' of null on leaflet.js:5 I have function, which get data from server, everything works, when I call function getData , I get data and function printRoute writes data to "test" element, but L.polyline([... still returns error. Data ( output of xhttp.responseText ) are in right format, which L.polyline needs ( [ 49.999319, 13.897081 ], [ 49.997681, 13.905933 ], ... , [ 49

passing file to controller without using form,

丶灬走出姿态 提交于 2021-02-08 10:35:16
问题 guys i am trying to load file from view to controller with out using form , while browsing a file the file should be loaded to controller using Ajax ,is it possible? <td>Import Excell file:</td> <td><input type="file" id="fileUpload" name="fileUpload" /></td> $('#fileUpload').die().live("change", function (e) { e.preventDefault(); var file_name = $("#fileUpload").val(); var fileName = $("#fileUpload").val(); var fileExtension = fileName.substring(fileName.lastIndexOf('.') + 1); var file_data

How to call included php file with AJAX?

那年仲夏 提交于 2021-02-08 10:24:44
问题 I am not sure if this is best approach, but how to make AJAX call with included file? Let me make working simple example. I have, main index.php file, with following content, where I want to access all data returned from included file where magic happens. Data is array type in reality. <?php require_once('magic.php'); ?> <html> <body> <form action="<?=$_SERVER['PHP_SELF'];?>" method="POST"> <input type="text" name="variable" id="variable" /> <input type="submit" value="Do magic" name="submit"

JQuery tabs with hoverIntent

五迷三道 提交于 2021-02-08 09:55:10
问题 Hi: I am trying to implement a delay on the loading of JQuery tabs (the activation / raising of a tab, on a prolonged hover). While I implemented the StackOverflow solution described here, [1] Adding HoverIntent to jQuery UI Tabs JSFiddle: https://jsfiddle.net/mvo6n9tc/1/ ... I am interested in the code described in this much-upvoted StackOverflow solution, [2] Delay jquery hover event? In both cases the posts are very old, so my questions are: Is this still the preferred approach to the

JQuery tabs with hoverIntent

不打扰是莪最后的温柔 提交于 2021-02-08 09:54:45
问题 Hi: I am trying to implement a delay on the loading of JQuery tabs (the activation / raising of a tab, on a prolonged hover). While I implemented the StackOverflow solution described here, [1] Adding HoverIntent to jQuery UI Tabs JSFiddle: https://jsfiddle.net/mvo6n9tc/1/ ... I am interested in the code described in this much-upvoted StackOverflow solution, [2] Delay jquery hover event? In both cases the posts are very old, so my questions are: Is this still the preferred approach to the

Bootstrap 4 Modal opened by ajax call - close buttons don't work

回眸只為那壹抹淺笑 提交于 2021-02-08 09:43:24
问题 I have a problem with my Bootstrap modals. I am using an $.ajax call, so I can send POST data to a separate .php file, to be displayed in the opened modal. I've been using Bootstrap 3, and I had no bugs, but when I upgraded to Bootstrap 4, my modals will not close. Originally I found techniques that used show.bs.modal here on StackOverflow, as I did my research to build my website. I stripped down my code as simple as I could for testing purposes, so I can replicate it here in this question.

Bootstrap 4 Modal opened by ajax call - close buttons don't work

放肆的年华 提交于 2021-02-08 09:42:51
问题 I have a problem with my Bootstrap modals. I am using an $.ajax call, so I can send POST data to a separate .php file, to be displayed in the opened modal. I've been using Bootstrap 3, and I had no bugs, but when I upgraded to Bootstrap 4, my modals will not close. Originally I found techniques that used show.bs.modal here on StackOverflow, as I did my research to build my website. I stripped down my code as simple as I could for testing purposes, so I can replicate it here in this question.