<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Efficy Overflow Q&amp;A - Recent questions tagged javascript</title>
<link>https://overflow.efficy.io/?qa=tag/javascript</link>
<description>Powered by Question2Answer</description>
<item>
<title>[Remote API - Javascript] Problem with the CORS policy</title>
<link>https://overflow.efficy.io/?qa=5028/remote-api-javascript-problem-with-the-cors-policy</link>
<description>&lt;p&gt;Hello ereryone,&lt;br&gt;
I created an Efficy query to retrieve active events or profiles. &lt;strong&gt;They must be processed in an external HTML page&lt;/strong&gt;. The event reception tests are conclusive in the Postman software.&lt;/p&gt;

&lt;p&gt;Unfortunately in Javascript, I receive the following message:&lt;br&gt;
&lt;strong&gt;Access to XMLHttpRequest at '&lt;a rel=&quot;nofollow&quot; href=&quot;https://labcrm.brrc.be/crm/json&quot;&gt;https://labcrm.brrc.be/crm/json&lt;/a&gt;' from origin '&lt;a rel=&quot;nofollow&quot; href=&quot;http://cms_test.brrc.be&quot;&gt;http://cms_test.brrc.be&lt;/a&gt;' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here the Javascript code:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;const uri = 'https://xxxx.brrc.be/crm/json';
var settings = {
  &quot;async&quot;: true,
  &quot;crossDomain&quot;: true,
  &quot;url&quot;: &quot;https://xxxx.brrc.be/crm/json&quot;,
  &quot;method&quot;: &quot;POST&quot;,
  &quot;headers&quot;: {
&quot;Access-Control-Allow-Origin&quot;: '*',
&quot;Access-Control-Allow-Credentials&quot;: 'true',
    &quot;X-Efficy-Customer&quot;: &quot;CRR&quot;,
    &quot;X-Efficy-ApiKey&quot;: &quot;&quot;,
&quot;X-Efficy-Logoff&quot;: &quot;false&quot;,
&quot;X-Efficy-Lang&quot;: &quot;EN&quot;,
&quot;Cache-Control&quot;: &quot;no-cache&quot;,
    &quot;X_CLIENT_APP&quot;: &quot;CRR&quot;,
&quot;Content-Type&quot;: &quot;application/json&quot;,
&quot;Accept&quot;: &quot;application/json&quot;
  },
  &quot;processData&quot;: false,
  &quot;data&quot;: &quot;[\r\n\t{\r\n\t\t\&quot;@name\&quot;: \&quot;api\&quot;,\r\n\t\t\&quot;@func\&quot;: [\r\n\t\t\t{\r\n\t\t\t\t\&quot;@name\&quot;:\&quot;query\&quot;,\r\n\t\t\t\t\&quot;key\&quot;:\&quot;4102\&quot;\r\n\t\t\t}\r\n\t\t]\r\n\t}\r\n]&quot;
}
$.ajax(settings).done(function (response) {
  console.log(response);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Still, I added the following headers:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&quot;Access-Control-Allow-Origin&quot;: '&lt;a rel=&quot;nofollow&quot; href=&quot;http://xxxx.brrc.be&quot;&gt;http://xxxx.brrc.be&lt;/a&gt;' or '*',&lt;br&gt;
  &quot;Access-Control-Allow-Credentials&quot;: 'true'&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;From what I understand, these instructions are placed server side so I do not understand what I have to write.&lt;/p&gt;

&lt;p&gt;Would you have an idea for me?&lt;br&gt;
In advance, I thank you.&lt;br&gt;
Best regards,&lt;br&gt;
Bruno&lt;/p&gt;
</description>
<category>Other</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5028/remote-api-javascript-problem-with-the-cors-policy</guid>
<pubDate>Wed, 27 Nov 2019 14:28:51 +0000</pubDate>
</item>
<item>
<title>[Solution] Don't be fooled by parseInt()</title>
<link>https://overflow.efficy.io/?qa=3874/solution-dont-be-fooled-by-parseint</link>
<description>&lt;p&gt;Hello Team, &lt;/p&gt;

&lt;p&gt;I would like to share with you a problem I encountered yesterday.&lt;br&gt;
If, like me, you never worked on old version of Javascript, with old browser, you could be used to do that : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;parseInt(&quot;011&quot;) // return 11
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;But Efficy use not the same version of Javascript as your browser. He use a version before ECMA5.&lt;/p&gt;

&lt;p&gt;So, this : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;parseInt(&quot;011&quot;) // return 9
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The explanation is simple. Before ES5, the base used by default was not always 10 (it was depending the string you wanted to parse). The documentation is clear about that : &lt;a rel=&quot;nofollow&quot; href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt&quot;&gt;parseInt sur MDN&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So the solution is : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;parseInt(&quot;011&quot;, 10) // return 11
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Or, even better, the Efficy function : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;strToFloat(&quot;011&quot;) // ALWAYS return 11
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I hope you won't spend as much time as I did :) &lt;/p&gt;

&lt;p&gt;Loïc&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=3874/solution-dont-be-fooled-by-parseint</guid>
<pubDate>Wed, 23 Jan 2019 10:51:51 +0000</pubDate>
</item>
<item>
<title>Miscellaneous dialog (background)</title>
<link>https://overflow.efficy.io/?qa=1844/miscellaneous-dialog-background</link>
<description>&lt;p&gt;Hi guys,&lt;/p&gt;

&lt;p&gt;On the consult page of a company in our IVM, we have the command miscellanious, which opens a dialog where you can fill in a request for the cloud. The dialog seems to be absolute and the background cannot be touched until you close it..&lt;br&gt;
In some cases it would be very useful if we could implement this functionality (for e.g. Troostwijk).&lt;/p&gt;

&lt;p&gt;What i noticed is that if the command is clicked a div is inserted in the page, which sets the new css from the class: .reveal-modal-bg. It seems that this does the trick.&lt;/p&gt;

&lt;p&gt;Does anyone has an idea how to implement this in our customs?&lt;/p&gt;

&lt;p&gt;Thanks in advance!&lt;/p&gt;

&lt;p&gt;Regards,&lt;/p&gt;

&lt;p&gt;Michael&lt;/p&gt;
</description>
<category>Efficy/ Client side</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=1844/miscellaneous-dialog-background</guid>
<pubDate>Wed, 07 Sep 2016 12:07:31 +0000</pubDate>
</item>
<item>
<title>Script trigger action grids on mark done/undone</title>
<link>https://overflow.efficy.io/?qa=1765/script-trigger-action-grids-on-mark-done-undone</link>
<description>&lt;p&gt;Hi guys,&lt;/p&gt;

&lt;p&gt;Can somebody point me in the right direction to create a script from the Action GridColumns mark done/undone trigger?&lt;/p&gt;

&lt;p&gt;Regards,&lt;/p&gt;

&lt;p&gt;Michael&lt;/p&gt;
</description>
<category>Efficy/ Client side</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=1765/script-trigger-action-grids-on-mark-done-undone</guid>
<pubDate>Fri, 15 Jul 2016 09:25:31 +0000</pubDate>
</item>
<item>
<title>Does anyone know if we can use Node.js for Efficy?</title>
<link>https://overflow.efficy.io/?qa=1755/does-anyone-know-if-we-can-use-node-js-for-efficy</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Does anyone know if we can use node.js for Efficy?&lt;/p&gt;

&lt;p&gt;Regards&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=1755/does-anyone-know-if-we-can-use-node-js-for-efficy</guid>
<pubDate>Tue, 12 Jul 2016 14:26:55 +0000</pubDate>
</item>
<item>
<title>2014 equivalent for PopupAtElement</title>
<link>https://overflow.efficy.io/?qa=988/2014-equivalent-for-popupatelement</link>
<description>&lt;p&gt;what is the Efficy 2014 alternative for PopupAtElement ???&lt;/p&gt;

&lt;p&gt;I can't get this to work on  2014&lt;/p&gt;
</description>
<category>Efficy/ Client side</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=988/2014-equivalent-for-popupatelement</guid>
<pubDate>Tue, 01 Dec 2015 13:29:37 +0000</pubDate>
</item>
</channel>
</rss>