JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
Jan 17, 2019 10:51
yes, indeed
Jan 17, 2019 10:49
but the words are not the same when I do the question haha
Jan 17, 2019 10:49
yeah, I know
Jan 17, 2019 10:48
yes, I always try to find first if it has been already answered but since my english is not good enough I don't find it xD
Jan 17, 2019 10:45
but I always got downvoted or not voted at all :D
Jan 17, 2019 10:45
do you think that the question is good? I mean, I usually get downvoted and I try to do good questions since I try to edit and flag bad questions
Jan 17, 2019 10:44
By the way
Jan 17, 2019 10:44
Thank you so much
Jan 17, 2019 10:44
It does work perfectly
Jan 17, 2019 10:42
Alright didn't see it
Jan 17, 2019 10:40
@sriya 4.2
Jan 17, 2019 10:39
thanks you
Jan 17, 2019 10:39
im testing it and ill tell you
Jan 17, 2019 10:39
but without the Object.assign
Jan 17, 2019 10:39
I tried to do that
Jan 17, 2019 10:37
of course
Jan 17, 2019 10:35
but since it is not my decision, i cant haha
Jan 17, 2019 10:35
It would if I pay the license of the new version
Jan 17, 2019 10:35
and when I compile the app it fails because it doesn't support spread operator
Jan 17, 2019 10:35
it's because I use ExtJS
Jan 17, 2019 10:35
no
Jan 17, 2019 10:34
One more thing, if you think that is a good question I would be so happy to see an upvote :)
Jan 17, 2019 10:33
If there is no other way of doing it, for me would be also a valid answer
Jan 17, 2019 10:31
how ever I'm looking for any other was of doing it without spread operator
Jan 17, 2019 10:31
it has been answered very well
Jan 17, 2019 10:31
but read my edit
Jan 17, 2019 10:31
Yes
Jan 17, 2019 10:30
0
Q: Add or avoid adding a property in an object depending on a boolean within the object itself

OsakrBasically I wonder if I could avoid adding a property into an object if a variable is false but from inside the object. So let's say I have this object: var obj = { foo: 'bar', bar: 'foo' }; Now I want to rewrite the same object but I only want to add the second property if a new variable, wh...

Jan 17, 2019 10:30
Can you take a look at this question
Jan 17, 2019 10:30
Hi there
Jan 17, 2019 09:00
Hi
 

PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
Jan 17, 2019 09:02
Hello
Jan 10, 2019 13:45
@JoeWatkins muchas gracias de todas formas, me has quitado un peso de encima :)
Jan 10, 2019 13:39
should be the headers what was wrong with my code?
Jan 10, 2019 13:39
It does
Jan 10, 2019 13:38
@JoeWatkins thanks, i'll test it
Jan 10, 2019 13:30
This problem is driving me a little crazy
Jan 10, 2019 13:29
Would be OK to open a question about my issue?
Jan 10, 2019 13:27
If there were any critical error I would not get the response from the google API at first
Jan 10, 2019 13:21
also i tried to json_encode the array in the second attempt
Jan 10, 2019 13:19
and @curl_setopt($cli, CURLOPT_POSTFIELDS, http_build_query($this->post_fields));
Jan 10, 2019 13:19
@curl_setopt($cli, CURLOPT_POSTFIELDS, ['text' => 'hello']);
Jan 10, 2019 13:18
I've also tried this changes:
Jan 10, 2019 13:17
$cli = $this->setCurlOptions($cli);

if (!empty($this->post_fields)) {
// En caso de que el payload no este vacío añadimos sus elementos a la petición, utilizando
// parámetros POST
$_p = true;

@curl_setopt($cli, CURLOPT_POST, 1);
@curl_setopt($cli, CURLOPT_CUSTOMREQUEST, 'POST');
@curl_setopt($cli, CURLOPT_POSTFIELDS, '{"text":"hello"}');
}

$out = @curl_exec($cli);
Jan 10, 2019 13:17
$cli = curl_init($this->callbackUrl);

if (!$cli) {
die('Could not initialize the webhook');
}

$this->post_fields = $this->getPostFields();
Jan 10, 2019 13:15
but gimme a sec and ill send the curl part
Jan 10, 2019 13:15
well is quite hard the show the whole code since it is fragmented
Jan 10, 2019 13:15
and the api simply doesn't recognize the content
 
Jan 10, 2019 13:44
@DavidKlotz that's not the question you posted
Jan 10, 2019 13:44
@DavidKlotz easy: echo "Dr\xc3\xa4ger"; Avoid the use of simple quote