This topic is locked
[SOLVED]

 Promisses

10/1/2019 10:21:44 AM
PHPRunner General questions
J
jacques author

Just a simple question.
Can Promisses be used in javascript within PHPRunner?
Gr

J
John 10/1/2019

If you are referring to Sweetalerts... Yes..

John

J
jacques author 10/1/2019



If you are referring to Sweetalerts... Yes..

John


Yes, as an example
checking the syntax I get a "Compilation error Microsoft JScript " on .then and it is not working

Admin 10/1/2019

It's kind of hard to understand. What is your code? What error are you getting in the live application?

J
jacques author 10/1/2019



It's kind of hard to understand. What is your code? What error are you getting in the live application?


I've tried the most code-examples from https://sweetalert2.github.io.

Some of them works and some don't. When it doesn't work there is no visible error. Nothing happens.
Example code that does not work:
const ipAPI = 'https://api.ipify.org?format=json';
const inputValue = fetch(ipAPI)

.then(response => response.json())

.then(data => data.ip)
const { value: ipAddress } = await Swal.fire({

title: 'Enter your IP address',

input: 'text',

inputValue: inputValue,

showCancelButton: true,

inputValidator: (value) => {

if (!value) {

return 'You need to write something!'

}

}

})
if (ipAddress) {

Swal.fire(Your IP address is ${ipAddress})

}

The "syntax check" on the javascriptonload event gives the following message.

Compilation-error Microsoft JScript. line 1 (or line 4)
Do not put too much time in the search please.

It is only a question and not a necessity
gr
Jacques

Admin 10/1/2019

You need to see what kind of errors are happening in the live application:

https://xlinesoft.com/phprunner/docs/troubleshooting_javascript_errors.htm