C
C
CheGevara2018-05-22 15:52:03
JavaScript
CheGevara, 2018-05-22 15:52:03

How to make an ajax request if the site is running on exe (cgi)?

Good afternoon.
I have a website (I'm not the author, because maybe I'll write it wrong) generated through a gateway (CGI).
Page addresses look like http://url.ru/cgi-bin/site.exe?variable_set *server on apache under Windows
There is a task - to add additional functionality without touching the site itself. In fact, hang a js script.
I made a script, insert a link to it in the footer. There is an ajax request in the script that accesses a file on the server ( url.ru/filename.php ).

$.ajax({
        type: "POST",
        url: "http://url.ru/filename.php",
        data: --- бла бла бла

When the code is triggered, a page with the error Error request 10 opens! undefined command.
and an address like http://url.ru/cgi-bin/site.exe?set_of_transferred_...
Interestingly, the script accessed by js ( url.ru/filename.php ) works fine

---
author Valera, question closed

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
leni_m, 2018-05-22
@leni_m

php configured on the server?

A
Alexander, 2018-05-22
@NeiroNx

So maybe not "POST" but "GET" times the variables in the url ?

T
ThunderCat, 2018-05-22
@ThunderCat

Let's explain the task once again:
1) the site opens from the browser at url.ru/filename.php
2) the site returns (?) an error when requested by Ajax
3)

When the code is triggered, a page with the error Error request 10 opens! undefined command.
That is, when an Ajax(!) request is triggered, your page changes...
There is a suspicion that the code you provided is not complete, and the link to which the Ajax request event is written does not contain the necessary piece of code that does preventDefault(); and all your "jax" leaves on foot erotic route according to the url specified in the link.
The rest my third eye can't see - the dusk is restless and mana fluctuations...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question