Vì vậy, tôi đã viết một chương trình bằng JavaScript xuất ra JSON. Những gì tôi muốn làm là, với một nút bấm, tôi muốn chuyển trong JSON đó như một đối số cho một tập lệnh Python.
Tôi không hoàn toàn chắc chắn làm thế nào để tiến hành điều này:
$.ajax[{
url: "/path/to/your/scriptPython",
success: function[response] {
// here you do whatever you want with the response variable
}
}];
Bất kỳ phản hồi hoặc trợ giúp được đánh giá cao.
Được hỏi ngày 30 tháng 9 năm 2016 lúc 18:25Sep 30, 2016 at 18:25
3
Điều này phụ thuộc vào một cân nhắc quan trọng: Mã Python của bạn ở đâu?
Nếu bạn muốn Python chạy trên máy của người dùng, điều đó trở nên phức tạp do các biện pháp bảo mật: Các trang web thường không được phép thực thi mã tùy ý trên máy của người xem. [Hãy tưởng tượng nếu mã Python đó xóa ổ cứng của họ, ví dụ: trong trường hợp này, tốt nhất là người dùng sẽ tải JSON dưới dạng tệp và sau đó mở nó bằng chương trình Python của bạn.
Nếu bạn muốn Python chạy trên máy chủ của mình, bạn có thể thực hiện yêu cầu bài đăng đến điểm cuối của tập lệnh và chuyển JSON trong dữ liệu bài đăng. Các chi tiết về điều này sẽ phụ thuộc vào sự lựa chọn của bạn về khung web Python [tôi thích bình], nhưng JavaScript sẽ khá giống nhau:
$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
Đã trả lời ngày 30 tháng 9 năm 2016 lúc 18:44Sep 30, 2016 at 18:44
DraconisdraconisDraconis
3.0291 Huy hiệu vàng15 Huy hiệu bạc27 Huy hiệu đồng1 gold badge15 silver badges27 bronze badges
1
Đã tạo: tháng 3-22, 2022 Gọi tệp máy chủ từ Frontend [HTML] là một trường hợp sử dụng phổ biến cho mọi trang web động. Tất cả các trang web động kết nối với máy chủ thông qua các phương thức khác nhau. Bài viết này dạy cách gọi Python từ JavaScript. Ajax là viết tắt của JavaScript không đồng bộ và XML. Nó sử dụng đối tượng Nó có thể gửi và nhận thông tin theo nhiều định dạng, bao gồm các tệp HTML, XML, JSON và văn bản. Tính năng thú vị nhất của Ajax là bản chất không đồng bộ của nó, điều đó có nghĩa là nó có thể giao tiếp với máy chủ, trao đổi dữ liệu và làm mới trang trong khi không phải làm mới trang. Hai tính năng chính của AJAX cho phép bạn thực hiện bên dưới. Syntax: Example: Trong mã trên, chúng tôi thực hiện các yêu cầu Sử dụng
ajax
để gọi Python từ JavaScriptXMLHttpRequest
để giao tiếp với các máy chủ.$.ajax[{
url: "SERVER_URL",
data: { param: text },
type: "HTTP_METHOD",
}].done[function[] {
/* Process the data */
}];
ajax
chấp nhận URL dưới dạng tham số đầu vào, một chuỗi chứa URL mà yêu cầu được gửi.JSON
chứa các tham số để gửi đến máy chủ. Nếu phương thức HTTP
là một phương thức không thể có cơ thể thực thể, chẳng hạn như
0, dữ liệu được thêm vào URL.$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
1 là phương thức $.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
HTTP
được sử dụng để yêu cầu máy chủ.
3 là một cấu trúc thay thế cho tùy chọn gọi lại thành công và vui lòng tham khảo $.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
4 để biết chi tiết thực hiện.$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
5 cho máy chủ với tham số là $.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
6. Nó sẽ gọi tệp python $.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
7, sẽ chấp nhận các tham số đầu vào và xử lý dữ liệu.$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
Sau đó, nó sẽ trả lại phản hồi cho khách hàng.
Output:
Thank you.
$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
8 $.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
9$.ajax[{
url: "SERVER_URL",
data: { param: text },
type: "HTTP_METHOD",
}].done[function[] {
/* Process the data */
}];
0 $.ajax[{
url: "SERVER_URL",
data: { param: text },
type: "HTTP_METHOD",
}].done[function[] {
/* Process the data */
}];
1$.ajax[{
url: "SERVER_URL",
data: { param: text },
type: "HTTP_METHOD",
}].done[function[] {
/* Process the data */
}];
2$.ajax[{
url: "SERVER_URL",
data: { param: text },
type: "HTTP_METHOD",
}].done[function[] {
/* Process the data */
}];
3$.ajax[{
url: "SERVER_URL",
data: { param: text },
type: "HTTP_METHOD",
}].done[function[] {
/* Process the data */
}];
4$.ajax[{
url: "SERVER_URL",
data: { param: text },
type: "HTTP_METHOD",
}].done[function[] {
/* Process the data */
}];
5$.ajax[{
url: "SERVER_URL",
data: { param: text },
type: "HTTP_METHOD",
}].done[function[] {
/* Process the data */
}];
6$.ajax[{
url: "SERVER_URL",
data: { param: text },
type: "HTTP_METHOD",
}].done[function[] {
/* Process the data */
}];
0 $.ajax[{
url: "SERVER_URL",
data: { param: text },
type: "HTTP_METHOD",
}].done[function[] {
/* Process the data */
}];
8$.ajax[{
url: "SERVER_URL",
data: { param: text },
type: "HTTP_METHOD",
}].done[function[] {
/* Process the data */
}];
2$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
0$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
1 $.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
2$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
4$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
5$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
7$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
5$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3Thank you.
0$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
5$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3Thank you.
3$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
5$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3Thank you.
6$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
5$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3Thank you.
9$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
5$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3ajax
2$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
5$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3ajax
5$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
5$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3ajax
8$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
5$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3XMLHttpRequest
1$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
5
$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3XMLHttpRequest
4$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
5$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3XMLHttpRequest
7$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
5$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3ajax
0$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
5$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3ajax
3 ajax
4$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
5$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3ajax
4$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
5$.ajax[{
url: "SERVER_URL",
data: { param: text },
type: "HTTP_METHOD",
}].done[function[] {
/* Process the data */
}];
2JSON
0$.ajax[{
url: "SERVER_URL",
data: { param: text },
type: "HTTP_METHOD",
}].done[function[] {
/* Process the data */
}];
2JSON
2$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
1 $.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
2$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3JSON
6JSON
7 JSON
8$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3HTTP
0JSON
7 HTTP
2$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3HTTP
4$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3HTTP
6$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
5$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3HTTP
9$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
5$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
02$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
04$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
06$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
08JSON
7 $.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
10$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
12$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
14$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
5$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
17$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
19$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
21$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
22 $.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
23$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
25$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
26 $.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
27$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
28 $.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
29$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
31$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
33$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
34$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
35$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
37$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
38 $.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
39$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
41$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
43$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
22 $.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
45$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
47$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
49$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
22 $.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
51$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
53$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
55$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
56$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
57$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
59$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
61 $.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
62$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
64$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
66JSON
7 $.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
68$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
70$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
72$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
74$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
75$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
76$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
22 $.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
78$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
80$.ajax[{
url: "SERVER_URL",
data: { param: text },
type: "HTTP_METHOD",
}].done[function[] {
/* Process the data */
}];
2JSON
0$.ajax[{
url: "SERVER_URL",
data: { param: text },
type: "HTTP_METHOD",
}].done[function[] {
/* Process the data */
}];
2$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
84 $.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
85$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
87$.ajax[{
url: "SERVER_URL",
data: { param: text },
type: "HTTP_METHOD",
}].done[function[] {
/* Process the data */
}];
2$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
89$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
90$.ajax[{
type: "POST",
url: "~/helloWorld.py",
data: {
param: "hello world",
}
}].done[[o] => {
console.log[o]
}];
3$.ajax[{
type: 'POST',
data: my_json_variable,
url: '//example.com/python_endpoint',
success: function[response]{ /* deal with the script's output */ }
}];
92