Click here to Skip to main content
15,867,686 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: Looking to run a PHP page in the background using pure Javascript Pin
DerekT-P17-Dec-20 22:54
professionalDerekT-P17-Dec-20 22:54 
GeneralRe: Looking to run a PHP page in the background using pure Javascript Pin
jkirkerx18-Dec-20 6:10
professionaljkirkerx18-Dec-20 6:10 
GeneralRe: Looking to run a PHP page in the background using pure Javascript Pin
DerekT-P18-Dec-20 7:11
professionalDerekT-P18-Dec-20 7:11 
GeneralRe: Looking to run a PHP page in the background using pure Javascript Pin
jkirkerx18-Dec-20 7:53
professionaljkirkerx18-Dec-20 7:53 
GeneralRe: Looking to run a PHP page in the background using pure Javascript Pin
DerekT-P18-Dec-20 8:26
professionalDerekT-P18-Dec-20 8:26 
GeneralRe: Looking to run a PHP page in the background using pure Javascript Pin
jkirkerx18-Dec-20 8:47
professionaljkirkerx18-Dec-20 8:47 
AnswerRe: Looking to run a PHP page in the background using pure Javascript Pin
jkirkerx18-Dec-20 12:27
professionaljkirkerx18-Dec-20 12:27 
AnswerRe: Looking to run a PHP page in the background using pure Javascript Pin
jkirkerx18-Dec-20 13:31
professionaljkirkerx18-Dec-20 13:31 
I can only have 1 then in the fetch, with catch.
On Postman, my JSON is there in the body from the PHP page.
I'll figure it out eventually. But be my Fetch.
C#
spinner.classList.remove('hide');        
spinner.classList.add('show');

const saveUrl = 'msrp-api-async.phtml?save=1&cachebuster=' + (new Date()).valueOf();

fetch(saveUrl, { mode: 'same-origin', headers: { "Content-Type": "application/json; charset=utf-8" }})
.then(response => {

    console.log("response: ", response);                
    console.log("Request succeeded with JSON response: ", JSON.stringify(response.json));                

    // Shut down the spinner
    spinner.classList.remove('show');        
    spinner.classList.add('hide');

})            
.catch(err => {

    // Shut down the spinner
    spinner.classList.remove('show');        
    spinner.classList.add('hide');

    console.log("Ajax error - ", err);
    alert("An error has occurred, and no error code has been written yet to debug the error")
});
If it ain't broke don't fix it
Discover my world at jkirkerx.com

AnswerGot it Pin
jkirkerx18-Dec-20 13:47
professionaljkirkerx18-Dec-20 13:47 
QuestionFinding the definition of a component from the place of its use Pin
simpledeveloper18-Dec-20 19:43
simpledeveloper18-Dec-20 19:43 
QuestionRe: Finding the definition of a component from the place of its use Pin
Richard MacCutchan17-Dec-20 23:39
mveRichard MacCutchan17-Dec-20 23:39 
AnswerRe: Finding the definition of a component from the place of its use Pin
simpledeveloper18-Dec-20 15:40
simpledeveloper18-Dec-20 15:40 
GeneralRe: Finding the definition of a component from the place of its use Pin
Richard MacCutchan18-Dec-20 22:40
mveRichard MacCutchan18-Dec-20 22:40 
Questiondatepicker on button click not working Pin
Dhyanga17-Dec-20 3:45
Dhyanga17-Dec-20 3:45 
QuestionTernary operator Pin
atomattacker-png12-Dec-20 5:06
atomattacker-png12-Dec-20 5:06 
AnswerRe: Ternary operator Pin
Sandeep Mewara12-Dec-20 5:42
mveSandeep Mewara12-Dec-20 5:42 
GeneralRe: Ternary operator Pin
atomattacker-png12-Dec-20 6:01
atomattacker-png12-Dec-20 6:01 
QuestionReference an code behind variable in an external js fn Pin
Member 1492460710-Dec-20 8:42
Member 1492460710-Dec-20 8:42 
AnswerRe: Reference an code behind variable in an external js fn Pin
BabyYoda10-Dec-20 8:58
BabyYoda10-Dec-20 8:58 
GeneralRe: Reference an code behind variable in an external js fn Pin
Member 1492460710-Dec-20 9:45
Member 1492460710-Dec-20 9:45 
AnswerRe: Reference an code behind variable in an external js fn Pin
BabyYoda10-Dec-20 10:06
BabyYoda10-Dec-20 10:06 
GeneralRe: Reference an code behind variable in an external js fn Pin
Member 1492460710-Dec-20 11:27
Member 1492460710-Dec-20 11:27 
QuestionDrawGameScreen funtion not executing Pin
Member 150158428-Dec-20 12:19
Member 150158428-Dec-20 12:19 
SuggestionRe: DrawGameScreen funtion not executing Pin
Richard MacCutchan8-Dec-20 22:24
mveRichard MacCutchan8-Dec-20 22:24 
GeneralRe: DrawGameScreen funtion not executing Pin
Member 150158429-Dec-20 8:32
Member 150158429-Dec-20 8:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.