Categories
Mastering Development

AJAX POST request with json data to a spring controller returns status 405

I’m using spring-thymeleaf to return a page with an object as a spring attribute. And then making an AJAX POST request to a spring controller. Some how im getting There was an unexpected error (type=Method Not Allowed, status=405). Request method ‘GET’ not supported error which is strange im not doing any GET request. This is […]

Categories
CMS Development Wordpress

Fragments to Update Cart Counter not working on homepage – Woocommerce

I’m creating a website where the users can add a product to cart (using ajax) from homepage. I’m using a JS function to do this, and it’s working. Also, I have a function that updates the custom cart counter from header. If i’m on Shop or Cart page, the woocommerce fragments works perfectly, updating my […]

Categories
Mastering Development

Datatables doesn’t load the table when Json_encoded array gets large

I am using Datatables 1.10.20. The table does not have any prooblems with a not too long json. So far as the json contains less than about 100 rows, datatables plugin is able to load the data, however, when the json gets larger, and contains more rows, it shows up defective and datatables stops working […]

Categories
Mastering Development

Datatables invalid Json error while the Json is correct

Using PDO, I get an associative array and then turn it into json for an AJAX call. I assume there is no problem with this part, and inspecting via Google Chrome, I realize that the array sent is, as I reckon, without any problems. As a matter of fact, I get about 119 rows in […]

Categories
Development

MVC POP Up and PostBack

I have a MVC c#, signalR project where Agent follow below steps in Application Login To application. Once login success application hides Login div panel & displays list of campaign & telephony buttons Application displays list of campaigns agent is assigned to Application displays button in front of each campaign to set Ready / Not […]

Categories
Development

Ajax Canvas Image and other variables

My application is MVC 5, I am trying to send canvas image and other variables to the controller using: $(“#btnSave1”).click(function () { var image = document.getElementById(“canvas”).toDataURL(“image/png”); image = image.replace(‘data:image/png;base64,’, ”); $.ajax({ type: ‘POST’, url: ‘@Url.Action(“Save”, “Home”)’, data: { “imageData” : image, “varx”: myvar }, contentType: ‘application/json; charset=utf-8’, dataType: ‘json’, success: function (msg) { alert(‘Image saved […]

Categories
Development

How to download a document generated with python-docx in Django project?

I’m trying to figure how to download a word document generated with python-docx in my django app (I’m still learning and this is the first time I working with documents); with the help of ajax I send all the information needed to the view and call a function that uses that information and returns the […]

Categories
Development

Select2 is showing “No result found” message when selecting second time

I am using Select2 with ajax option and its a multiple selection box. I am able to select the record first time after selecting first. After that if i try the next one it is not working. $(‘#select2_ajax_complex_id’).select2({ tags: true, maximumSelectionSize: 10, minimumResultsForSearch: Infinity, multiple: true, minimumInputLength: 1, placeholder: “Search Employee”, //data:o, id: function(i) { […]

Categories
CMS Development Wordpress

Add “All Posts” button to custom post taxonomy filter with ajax in wordpress

Does somebody know how to add “All Posts” button to my custom post (“albums”) with custom taxonomy (“album_category”)? I can see my categories (Mixing, Mastering, Production) and when I click on them it shows me the posts that have been ticked under the certain category (Mixing, Mastering, Production). What I want is to have also […]

Categories
Development

bar chart with value

Hello WH i hope you see this , i have a problem with this when i’m addidng this type: ‘string’, role: ‘style’, calc: ‘stringify’, sourceColumn: 1, role: ‘annotation’ it’s working and showing the value at the bar chart , but it’s given me all the bars with one color . you will under stand when […]