Linked Questions

3 votes
2 answers
8k views

Vanilla JavaScript AJAX form submit

I need help to make a form submit using AJAX in Vanilla JavaScript (No jQuery). I have this jQuery Code that i need converted to JavaScript. $(document).ready(function() { $('.myForm').submit(...
952 votes
6 answers
996k views

URL encoding the space character: + or %20?

When is a space in a URL encoded to +, and when is it encoded to %20?
807 votes
44 answers
2.1m views

Include another HTML file in a HTML file

I have 2 HTML files, suppose a.html and b.html. In a.html I want to include b.html. In JSF I can do it like that: <ui:include src="b.xhtml" /> It means that inside a.xhtml file, I can include ...
4 votes
4 answers
42k views

calculate two input field values in javascript

Hi i want to calculate two input field values and result will show in third input field so i want to write code in ajax page <input id="a1" type="text" /> <input id="a2" type="text" onblur="...
1 vote
1 answer
5k views

How to send a FastAPI response without redirecting the user to another page?

I am creating an API using FastAPI, which receives form-data from an HTML page, process the data (requiring a few moments) and returns a message saying this task is complete. This is my backend: from ...
0 votes
1 answer
443 views

ASP NET MVC Server Response to a basic ajax request

We have to make an ASP.NET MVC or ASP.NET application for basic ajax navigation in Customer.html of Notrhwind.mdb. We have this 3 things: A pure HTML/JavaScript form having HTML input text tags, one ...
1662 votes
7 answers
1.9m views

application/x-www-form-urlencoded or multipart/form-data?

In HTTP there are two ways to POST data: application/x-www-form-urlencoded and multipart/form-data. I understand that most browsers are only able to upload files if multipart/form-data is used. Is ...
4 votes
4 answers
34k views

What are the alternative ways of making an Ajax call?

I'm wondering what is the best way to make an AJAX call. This is what I have right now, and it works just fine. $.ajax({ url: "/rest/computer", type: "GET", dataType: "json", ...
0 votes
1 answer
2k views

Stop page refresh on button click in spring boot

I am having a form and in that checkbox and button is present, on click of button, the data are submitting and also inserting in database, but my page is refreshing, I want my data should submit and ...
2 votes
3 answers
4k views

How to write Ajax call delete method with specific id in vanilla javascript

How do I write this peace of Ajax call that is written in jQuery, completely in vanilla JavaScript What should be converted into vanilla javascript $.ajax({ type: "DELETE", url: "/users/...
0 votes
1 answer
143 views

Display PHP string as an HTML table?

I have a server side csv table. I want to apply a filter from my html page and see the see the filtered table on the html page; My HTML code <!DOCTYPE html> <html lang="en"> <...
0 votes
1 answer
63 views

How do you send a request and display 1 part of the information on the page using javascript

How do i make a get request to https://my-ocular.jeffalo.net/api/users/PoIygon and display the "status" on status, "color" is the background color of the id "color" and &...
7 votes
2 answers
16k views

Equivalent of getJSON function without jQuery [duplicate]

What would be the equivalent of this approach without jQuery ? $(function() { $.getJSON("datas.json", function(e) { var t = []; $.each(e, function(e, t) { $("div#" + e)...
2 votes
1 answer
154 views

Get Ajax HTML element by using JavaScript bookmarklet

I am new to bookmarklet, not sure how much can be done with this. I want to get some elements from webpage, but the content will not show up till i click some buttons. I was able to get something on ...
0 votes
0 answers
611 views

Wordpress Vanilla JS Ajax load more posts - problem with offset / duplicating posts

Problem with duplicated posts.. The problem of duplicated posts accures when somebody scroll fast or just press END key. If scroll is fast, or even scrolled to the end of the page, there are always ...
0 votes
0 answers
97 views

Execute python script when button is clicked in HTML (or PHP)

This is my Python Script: from gtts import gTTS from playsound import playsound message = 'I'm Happy' language = 'en' speech = gTTS(text = message, lang = language, slow=False) speech.save('test....
0 votes
2 answers
68 views

How can you output the values in the same page?

I'm trying to build an email scraper on Django and that when you enter a URL, the result should be outputted in the same page. For now, the result is outputted in another page but I want it to be in ...
0 votes
1 answer
4k views

Get geolocation by Javascript and save it to text file via php

I want to get latitude and longitude of the guest and save them to a text file.. I used this: <html> <body> <?php $location = print ' <SCRIPT LANGUAGE="JavaScript"> window....
3 votes
3 answers
7k views

get data from JSON Object according to a key

I have this JSON Object. { "headerContent": [ { "name": "User Id", "key": "userId", "type": "text", ...
-1 votes
1 answer
147 views

send array in javaScript to PHP with ajax [duplicate]

I have array = ["h1","h2","h3","h4"] in index.html with JavaScript how can I send it to PHP file with ajax
0 votes
2 answers
4k views

How to make a post request processed in the background

I've currently got the following button: <input class="submitbutton" name="start" type="button" value="start" onClick="window.location='vservermanage.php?_v=<?=$this->vid;?>'"> ...
6 votes
2 answers
1k views

Different results for tensorflowjs and keras on same model and tensor

I trained a CNN model on some images following the example of https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html. My model code is identical, I just ...
1 vote
2 answers
2k views

Is it possible to use AJAX Delete request without jquery

I wanted to use AJAX delete request without using jquery is it possible to do that my json object at localhost:8000 looks like this : { "Students":[{"Name":"Kaushal",&...
158 votes
2 answers
363k views

Sending a JSON to server and retrieving a JSON in return, without JQuery

I need to send a JSON (which I can stringify) to the server and to retrieve the resulting JSON on the user side, without using JQuery. If I should use a GET, how do I pass the JSON as a parameter? Is ...
8 votes
4 answers
9k views

passing php string with multiple lines to a javascript function/variable

I'm working on someone else's website and it has a very stupid logic! Anyway, there is a php variable which contains a string which comes from database. $x = ' aaaa bbb ccc gggg '; and I need to ...
0 votes
1 answer
1k views

AJAX and pure Javascript [duplicate]

is there any code that is similar to the code in the bottom but in a regular js and not in jquery? thank you! $(function(){ $.ajax({ url: 'http://localhost:28017/local/andyb', type: 'get', ...
0 votes
2 answers
515 views

Simulate a JavaScript Button click with a Linux/Windows CLI line tool (http request)

Got a classic JS button : <button class="my-button" OnClick="(windows.open('https://anotherwebsite.com'))">CLICK ME</button> I would like to trigger this button with a CLI tool like cURL ...
-1 votes
1 answer
91 views

How to .js file $ajax code defined '$ not defined error''? [closed]

var deneme = document.createElement("SCRIPT"); deneme.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"; var nodeajax = document.createTextNode("function deneme() {console.log('...
0 votes
0 answers
46 views

How to fix thymeleaf simple System.out.print from Java method? [duplicate]

I am trying to call a method that returns a model and prints out a simple message to the console using Thymeleaf. However, I realize that whenever I setup the action to be called it does not work the ...
0 votes
1 answer
64 views

How can I pass content to an element in clients html page?

I'm currently using Node.js to serve a webpage that takes in user inputs which are stored on a mongodb server. The web page also displays specified or all user inputs entered. I'm trying to figure how ...
0 votes
0 answers
54 views

How to send variables from client sided code to server sided code

I am using the Google API to sign in users . They can sign in but i need to then send the information to the server side code from the client side I'm not to sure how to approach this, i have looked ...
0 votes
1 answer
504 views

How to send PHP array of images to Javascript array and display them

Noobie here, Apologies if this question is silly, I have developed a image match game with set of default images, now i want to access random images from directory for the game.The game logic is done ...
0 votes
0 answers
83 views

Javascript xmlHttp GET request readyState stuck at 1 using AWS

Here's two scripts for an e-commerce website, it takes the input from the search bar and creates an httprequest to the AWS api (in order to show the searched item page). To make it easier I'm trying ...
1 vote
0 answers
50 views

pass variable of javascript to php to the current page [duplicate]

i have read in many place that i can t pass a variable of js to the php code but i don t understand why, ok i know that it isn t so tidy make that but i didn t know why i could do that, here i have a ...
-4 votes
1 answer
2k views

How to store JavaScript variable in the database

I wanted to store the value "totalscore" from my JavaScript code to my database. I tried using ajax call but something is not working, I have not used ajax before. In the following JavaScript code, I ...
0 votes
4 answers
199 views

How to run a link without the output showing

Hi all I might be way off so please let me know if there is a better way, but I have is some tasmoto sonoff devices and I have this link of code on a button to toggle the light on and off ...
0 votes
1 answer
959 views

Execute Sql Query in php using onchange event in html Form [duplicate]

I have a html php file. in this file i have a form containing two select boxes employee department and employee branch. if i click the employee department select box it should execute a sql query ...
-1 votes
1 answer
57 views

HTML input into JSON via Client Side JS [duplicate]

I have an HTML form getting user input and I am looking to use client side Javascript to turn the form data into JSON. See UPDATE below for code~ Assuming the params info is correct, how do I post ...
1 vote
1 answer
101 views

php - how to get and send href link by multiple class

I have list of items with the same class name - "fileLink" When i submit the form below I would like to send, via AJAX, the list of file URL to the AJAX file (and the email address that user type). ...
1 vote
2 answers
1k views

How to get a value from page source code from a function tag?

here is the function from the source code function dosubmit() { if (getObj("Frm_Username").value == "") { getObj("errmsg").innerHTML = "Username cannot be empty."; getObj("...
-3 votes
3 answers
92 views

Why isn't this server/client connection working? [duplicate]

I'm setting up my first server with node.js, but I don't know how to connect a client and that server. I don't want to use jquery, and all the questions I could find about this involved jquery or were ...
0 votes
1 answer
24 views

how to use ajax to stop refreshing of entire web page? [duplicate]

I am struggling a bit to apply ajax to my current code. I am new and not too sure how to go about it. Thanks in advance. Code: <script> function openTab(NetworkTabs,elmnt,color) { var i,...
2 votes
1 answer
54 views

How to send multiple data with javascript in ajax and redirect it to a welcome page

How to send multiple data with java script in ajax and redirect it to a welcome page like if i have a function.. script.js function senddata() { //ajax code here } action.php echo $_POST['username'...
0 votes
1 answer
2k views

How to perform Lazy Loading in JSP-Servlet?

I have some homework to equip Lazy Loading into my java project using JSP-Servlet. I have not learned front-end development so I'm having difficulties accomplishing this task. When I run the web, it ...
0 votes
0 answers
37 views

can i convert simple form post in to ajax form post

I want to convert this simple posting form into ajax posting form I tried to do this but does could not do this please help me my code is given below and i want to change it to ajax submit can you ...
0 votes
1 answer
2k views

Passing value from one field to other field in django form

I have two django models ModelA and ModelB. class ModelA(models.Model): fieldA1 = models.CharField() fieldA2 = models.CharField() fieldA3 = models.ManyToManyField('ModelC') class ModelB(...
0 votes
1 answer
1k views

Django: Search Multiple Fields of A Django Model with Multiple Input field (with Drop Down) in HTML

How can I implement a Drop-Down search in Django where users can search through a listing of second hand cars. The HTML search page will have 3 dropdown search input for Brand, Colour, Year. Once ...
-1 votes
2 answers
426 views

Can't figure out How to change the input file to an static folder file

I have a 'stolen' code here, which i want to change the input sector to a file in my folder on the server without uploading the file first. The problem is that I am a little bit bad in javascript to ...
0 votes
1 answer
1k views

jQuery .ajax to Vanilla JavaScript

I am trying to convert an ajax request to vanilla JavaScript $.ajax({ url: 'http://foo.bar/hi', type: 'post', data: {args: params}, success: function(data){ }, }); I have tried ...
0 votes
2 answers
1k views

How to refresh Javascript variable without page refresh?

I have a Three.JS application that colors the object based on a text file: let color1 = 0x00ff00; let color2 = 0xFF04F0; In the Three.JS code: var cubeGeometry = new THREE.BoxGeometry(15, 1, 5); ...

15 30 50 per page
1
2 3 4 5