<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SAS Stored Process will not read javascript in Developers</title>
    <link>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339141#M5288</link>
    <description>&lt;P&gt;You have to store the files the directory of the web application. Files used by Stored Process WebApp, e.g, have to be stored in ?:\SAS\Config\LevX\Web\WebAppServer\SASServer1_1\sas_webapps\sas.storedprocess.war (using SAS 9.4). To prevent losing your files when applying a hotfix you should add those files to the installation directory.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Mar 2017 08:51:04 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2017-03-08T08:51:04Z</dc:date>
    <item>
      <title>SAS Stored Process will not read javascript</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339125#M5281</link>
      <description>&lt;P&gt;Hi SAS Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently doing R&amp;amp;D on how to make SAS Stored Process to read javascript function.&lt;/P&gt;&lt;P&gt;I have a sample javascript function and i put it in SAS Stored Proc file. However, when i run, the javascript function is not displaying at all. I need SAS Community to further guide me on this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the Stored Proc code that contains javascript&amp;amp;colon;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc printto log="D:\Data\SBO\CDS\ECMSTP\Test\log\Test.log" new;
run;
%LET path=D:/Data/SBO/CDS/ECMSTP/Test/jsgrid-1.5.3;
%put path is &amp;amp;path;


data _NULL_;
file _webout lrecl=2500;

put "&amp;lt;html&amp;gt;";

put "&amp;lt;head&amp;gt;";

put "&amp;lt;title&amp;gt;jsGrid - Basic Scenario Title&amp;lt;/title&amp;gt;";
put "&amp;lt;link rel=""stylesheet"" type=""text/css"" href=""demos.css"" /&amp;gt;";
put "&amp;lt;link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'&amp;gt;";

put "&amp;lt;link rel=""stylesheet"" type=""text/css"" href=""../css/jsgrid.css"" /&amp;gt;";
put "&amp;lt;link rel=""stylesheet"" type=""text/css"" href=""../css/theme.css"" /&amp;gt;";

put "&amp;lt;script src=""&amp;amp;path/external/jquery/jquery-1.8.3.js""&amp;gt;&amp;lt;/script&amp;gt;";
put "&amp;lt;script src=""db.js""&amp;gt;&amp;lt;/script&amp;gt;";

put "&amp;lt;script src=""&amp;amp;path/src/jsgrid.core.js""&amp;gt;&amp;lt;/script&amp;gt;";
put "&amp;lt;script src=""&amp;amp;path/src/jsgrid.load-indicator.js""&amp;gt;&amp;lt;/script&amp;gt;";
put "&amp;lt;script src=""&amp;amp;path/src/jsgrid.load-strategies.js""&amp;gt;&amp;lt;/script&amp;gt;";
put "&amp;lt;script src=""&amp;amp;path/src/jsgrid.sort-strategies.js""&amp;gt;&amp;lt;/script&amp;gt;";
put "&amp;lt;script src=""&amp;amp;path/src/jsgrid.field.js""&amp;gt;&amp;lt;/script&amp;gt;";
put "&amp;lt;script src=""&amp;amp;path/src/fields/jsgrid.field.text.js""&amp;gt;&amp;lt;/script&amp;gt;";
put "&amp;lt;script src=""&amp;amp;path/src/fields/jsgrid.field.number.js""&amp;gt;&amp;lt;/script&amp;gt;";
put "&amp;lt;script src=""&amp;amp;path/src/fields/jsgrid.field.select.js""&amp;gt;&amp;lt;/script&amp;gt;";
put "&amp;lt;script src=""&amp;amp;path/src/fields/jsgrid.field.checkbox.js""&amp;gt;&amp;lt;/script&amp;gt;";
put "&amp;lt;script src=""&amp;amp;path/src/fields/jsgrid.field.control.js""&amp;gt;&amp;lt;/script&amp;gt;";
put "&amp;lt;/head&amp;gt;";


put "&amp;lt;body&amp;gt;";
put "&amp;lt;h1&amp;gt;Basic Scenario Header&amp;lt;/h1&amp;gt;";
put " &amp;lt;div id=""jsGrid""&amp;gt;&amp;lt;/div&amp;gt;";

put "&amp;lt;script language=""JavaScript""&amp;gt;

        $(function() {

            $(""#jsGrid"").jsGrid({
                height: ""70%"",
                width: ""100%"",
                filtering: true,
                editing: true,
                inserting: true,
                sorting: true,
                paging: true,
                autoload: true,
                pageSize: 15,
                pageButtonCount: 5,
                deleteConfirm: ""Do you really want to delete the client?"",
                controller: db,
                fields: [
                    { name: ""Name"", type: ""text"", width: 150 },
                    { name: ""Age"", type: ""number"", width: 50 },
                    { name: ""Address"", type: ""text"", width: 200 },
                    { name: ""Country"", type: ""select"", items: db.countries, valueField: ""Id"", textField: ""Name"" },
                    { name: ""Married"", type: ""checkbox"", title: ""Is Married"", sorting: false },
                    { type: ""control"" }
                ]
            });

        });
    &amp;lt;/script&amp;gt;";
put "&amp;lt;/body&amp;gt;";
put "&amp;lt;/html&amp;gt;";
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the output screen:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/7611iA470E4AAF46020A4/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Basic scenario only.PNG" title="Basic scenario only.PNG" /&gt;&lt;/P&gt;&lt;P&gt;Only the html will be read but not the javascript function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone guide me on this?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 08:06:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339125#M5281</guid>
      <dc:creator>imdickson</dc:creator>
      <dc:date>2017-03-08T08:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Stored Process will not read javascript</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339130#M5282</link>
      <description>&lt;P&gt;How did you display the page source code in the browser?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 08:24:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339130#M5282</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-08T08:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Stored Process will not read javascript</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339131#M5283</link>
      <description>&lt;P&gt;Hi Kurt. Did you mean how did i show the result page?&lt;/P&gt;&lt;P&gt;It is a stored proc in SAS Enterprise Case Management(ECM) or aka SAS Anti-money laundering(AML) tool.&lt;/P&gt;&lt;P&gt;Appreciate if you can further assist.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 08:29:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339131#M5283</guid>
      <dc:creator>imdickson</dc:creator>
      <dc:date>2017-03-08T08:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Stored Process will not read javascript</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339136#M5284</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/63520"&gt;@imdickson&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think that the first check is to see the actual code that is being written to the output stream. Could you please create an html file from it and attach it to the thread? Then hopefully we can identify the problem. I would expect that the path of the js scripts are not being written properly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The second option I am considering, is that your browser has got some security settings that is blocking the execution of javascript from certain sources.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 08:37:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339136#M5284</guid>
      <dc:creator>JuanS_OCS</dc:creator>
      <dc:date>2017-03-08T08:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Stored Process will not read javascript</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339137#M5285</link>
      <description>&lt;P&gt;If you access your STP with a browser, the browser will act on the javascript and display the results, but not the javascript itself. To see the javascript, you need to look at the HTML source code.&lt;/P&gt;
&lt;P&gt;In Firefox, right-click in the displayed page and select Show Source Code.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 08:41:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339137#M5285</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-08T08:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Stored Process will not read javascript</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339138#M5286</link>
      <description>Hi Juan, i have attached the code in stored proc .sas file. Are those code that you want?&lt;BR /&gt;&lt;BR /&gt;Secondly, yes the top right corner is showing blocked not secured script from loading. However, clicking "allow" will not change anything in the output page still.</description>
      <pubDate>Wed, 08 Mar 2017 08:41:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339138#M5286</guid>
      <dc:creator>imdickson</dc:creator>
      <dc:date>2017-03-08T08:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Stored Process will not read javascript</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339140#M5287</link>
      <description>&lt;P&gt;What &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35204"&gt;@JuanS_OCS&lt;/a&gt; meant was that you should write the HTML to a disk file instead of _webout. Then we can inspect the file for its contents.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 08:46:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339140#M5287</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-08T08:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Stored Process will not read javascript</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339141#M5288</link>
      <description>&lt;P&gt;You have to store the files the directory of the web application. Files used by Stored Process WebApp, e.g, have to be stored in ?:\SAS\Config\LevX\Web\WebAppServer\SASServer1_1\sas_webapps\sas.storedprocess.war (using SAS 9.4). To prevent losing your files when applying a hotfix you should add those files to the installation directory.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 08:51:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339141#M5288</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2017-03-08T08:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Stored Process will not read javascript</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339142#M5289</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sorry for saying this, but I would rather not subscribe to your advise.&lt;/P&gt;
&lt;P&gt;While that can be true on versions of SAS previous to 9.4 (and only if you don't have an Apache server as reverse proxy), exactly because you refer to 9.4, all the static content should be better stored on the SAS Web Server (.../sashome/&lt;SPAN&gt;config/LevX/Web/WebServer/htdocs ), or even in the SAS Content Server in case you really need secured content... although I doubt most of the &amp;nbsp;javascript codes would require secured access.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Your solution is technically OK, "per se", and it was actually used before 9.4, but this other option reduces a lot the maintenance of the static content.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 08:59:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339142#M5289</guid>
      <dc:creator>JuanS_OCS</dc:creator>
      <dc:date>2017-03-08T08:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Stored Process will not read javascript</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339144#M5290</link>
      <description>&lt;P&gt;Hi Andreas, can you further elaborate things to do in the mentioned path? I can navigate to that folder.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 09:08:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339144#M5290</guid>
      <dc:creator>imdickson</dc:creator>
      <dc:date>2017-03-08T09:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Stored Process will not read javascript</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339151#M5291</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35204"&gt;@JuanS_OCS&lt;/a&gt;: Thanks for correcting my outdated information.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 09:44:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/339151#M5291</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2017-03-08T09:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Stored Process will not read javascript</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/350510#M5292</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35204"&gt;@JuanS_OCS&lt;/a&gt;&amp;nbsp;actually answered your question, albeit indirectly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The HTML you are writing with your put statements will actually be resolving to something like&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token string"&gt;&amp;lt;script src=""D:\whatever\your\path\was/src/jsgrid.core.js""&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is obviously wrong, as your browser needs to load your library from a web server, not a location on your disk. Imagine it being typed into the address bar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you need to do is copy your &lt;EM&gt;src&amp;nbsp;&lt;/EM&gt;directory with all the .js files you want to load&amp;nbsp;into your &lt;STRONG&gt;Config\LevX\Web\WebServer\htdocs&lt;/STRONG&gt; directory so that they are served up by the web server (assuming SAS 9.4). Then doing something like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token keyword"&gt;put&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"&amp;lt;script src=""/src/jsgrid.load-indicator.js""&amp;gt;&amp;lt;/script&amp;gt;"&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;for each of your includes ill load your library correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't agree with the design pattern of using STPs and put statements to generate HTML when you've got an actual web server / reverse proxy available with your environment, but that's a different conversation altogether.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nik&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2017 14:18:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Stored-Process-will-not-read-javascript/m-p/350510#M5292</guid>
      <dc:creator>boemskats</dc:creator>
      <dc:date>2017-04-17T14:18:14Z</dc:date>
    </item>
  </channel>
</rss>

