#JavaScript

5 Followers · 131 Posts

JavaScript, often abbreviated as JS, is a high-level, interpreted programming language. It is a language which is also characterized as dynamic, weakly typed, prototype-based and multi-paradigm.

Learn more.

Question Amit Prajapati · Aug 23, 2019

Hi All,

I have created a REST class in which have the Parameter HandleCorsRequest = 1;

I can able to access the API using Postman, but not with my web application. It throws the below error.

Access to XMLHttpRequest at 'http://localhost:52773/IrisVSCode/app/test' from origin 'null' 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.

Please note that I have tried all option which are mentioned on following URL:

https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.

5
0 16336
Question Syed M · Jul 27, 2021

Hi all,
    We have a session values in a cache method and need to get those values in a client method (JavaScript).
   
Eg : 
    ClassMethod Method1()
{
    Set %session.Data("Param1")="Data 1"
}

ClientMethod onloadHandler [Language = javascript]
{
   var ret = zenPage.getSessionValues();
}

ClassMethod getSessionValues() As %String [zenMethod]
{
   Set Data = $G(%session.Data("Param1"))
   Quit Data
}

This is the code we implemented. But the problem is getSessionValues() method isn't called.
We need to know how to call a class method from client method.

Thanks,
Syed M

1
0 543
Announcement Nikita Savchenko · Jan 19, 2017

Greetings, InterSystems community!

I am pleased to announce that the web terminal project, Caché WebTerminal version 4 gets its release! After long period of enhancing this web application from 2013, it came to the version 4, which features major stability and security improvements, intelligent autocomplete and syntax highlighting, convenient SQL mode and a lot of other useful features.

The goal of this article is to spread the knowledge about this project over the InterSystems community.

34
3 3801
Discussion Rob Tweed · Dec 16, 2020

There's been quite a bit of discussion lately in this forum on the tools available in IRIS for using both XML and JSON, and debate on cross-conversion between the two formats.

A week or so ago I posted details of a set of tutorials I'd put together on integrating the Node.js-based QEWD technology with IRIS, working over a network.  As part of that set of tutorials, I've been detailing how to use the various multi-model capabilities of the build-in QEWD-JSdb abstraction of IRIS.  QEWD-JSdb is a key part of QEWD, and understanding it is key to understanding how to develop applications (REST and

1
0 412
Question Andy Coutinho · Feb 25, 2021

Does anyone know how to get the closing tab/menu changing event in a CSP? I've tried the JS "OnBeforeUnload" already but it seems the browsers aren't allowing it anymore. I need to show a pop-up that holds the user if trying to get away before completing the stage.

1
0 169
Article Ward De Backer · Apr 20, 2017 5m read

Developing a Full-Stack JavaScript web app with Caché requires you to bring together the right building blocks. Previously, I outlined the basic steps to install and connect Node.js to Caché and make it's powerful multi-model database capabilites available for use with Node.js. You can use Caché as a NoSQL-, document- (with unique key-level access!), SQL- and object-database with Node.js. When developing JavaScript applications, you'll see how powerful this combination is and makes Caché a perfect fit for Node.js.

In the first part of this article series I will show how to get started with the React framework, one of the most popular frameworks currently taking over front-end development. In the next parts you'll learn how to connect a basic web app to a Caché back-end.

You'll see, it's very easy to get started with this technology - you can even compare the amount of basic knowledge you need to COS because you only need to know a few basic concepts to start!

8
2 5175
Article Rob Tweed · Oct 6, 2020 4m read

Those of you who are following the FullStack competition here in the Developer Community will know that I submitted an entry named qewd-conduit.  I wanted to summarise why I think it's something worth you taking a bit of time to check out.

qewd-conduit uses the Node.js-based QEWD framework alongside IRIS to implement the back-end REST APIs for something known as the RealWorld Conduit application:

https://github.com/gothinkster/realworld

This is a very cool initiative as it provides a platform for lots of different people to implement technically different solutions for both the back- and fr

6
1 673
Article Henrique Dias · Oct 6, 2020 2m read

What is npm-iris? 

N.P.M stands for "No Project Mess."

N.P.M. is a Project & Task Management app that uses InterSystems IRIS and Bootstrap 4.

No Project Mess is created to help developers and small business companies to reduce complexity in their daily problems, with a simple and intuitive projects and tasks management software. 

It offers different views for your tasks, from a spreadsheet, kanban, calendar, or even Gantt!

0
0 456
Article Chris Stewart · Apr 17, 2017 4m read

So, one day you're working away at WidgetsDirect, the leading supplier of widget and widget accessories, when your boss asks you to develop the new customer facing portal to allow the client base to access the next generation of Widgets..... and he wants you to use Angular 1.x to read into the department's Caché server.   

There's only one problem:  You've never used Angular, and don't know how to make it talk to Caché.

This guide is going to walk through the process of setting up a full Angular stack which communicates with a Caché backend using JSON over REST.  

Part 1 - Setup

To start f

23
3 5147
Article Renato Banzai · Aug 27, 2020 2m read

Whats NLP Stands For?

NLP stands for Natural Language Processing which is a field of Artificial Intelligence with a lot of complexity and techniques to in short words "understand what are you talking about".

And FHIR is...???

FHIR stands for Fast Healthcare Interoperability Resources and is a standard to data structures for healthcare. There are some good articles here explainig better how FHIR interact with Intersystems IRIS.

My Solution

Chatbot to query FHIR

The most common approach in chatbots is use machine learning to train the model based in old conversations. But when the chatbot need

picture

2
0 859
Question Arnold Cota · May 26, 2020

I am trying to set a varaible/property within JavaScript and use the value in my method.  The alert method below returns "0".  Do I have the syntax wrong?

/// Storage for current table row

Property currentTableRow As %ZEN.Datatype.string [ InitialExpression = 0 ];

set ..currentTableRow = "1"

&js<

    alert(zenPage.currentTableRow);
>

8
0 477
Article Bernd Mueller · Jan 30, 2018 13m read

Some time ago I got a WRC case transferred where a customer asks for the availability of a raw DEFLATE compression/decompression function built-in Caché.

When we talk about DEFLATE we need to talk about Zlib as well, since Zlib is the de-facto standard free compression/decompression library developed in the mid-90s.

Zlib works on particular DEFLATE compression/decompression algorithm and the idea of encapsulation within a wrapper (gzip, zlib, etc.).
https://en.wikipedia.org/wiki/Zlib


In Caché Object Script (COS) we already have GZIP support available in using /GZIP=1 on file- or tcp-devices

6
2 2829
Announcement Rob Tweed · May 15, 2020

I've created a new repository that I will use for providing examples of various scenarios and use cases for QEWD

https://github.com/robtweed/qewd-microservices-examples

Initially it contains a example of a scenario I'm often asked about: a set of REST APIs, with JWT support, implemented as a set of QEWD MicroServices, each of which uses Cache or IRIS running on a Windows system.

What I've provided is a detailed, step-by-step guide (with detailed explanations) of how to set up such a system.

The example shows a use case of REST APIs to:

- authenticate / login

- thereafter use a set of CRU

0
1 502
Article Ward De Backer · Apr 20, 2017 5m read

Full-Stack JavaScript development allows you to create state-of-the-art applications with Caché. With any (web) app you build nowadays, one has to make a lot of architectural decisions and you want to make the right ones. With the Node.js connector available for Caché, you can create a very powerful server side application server, allowing you to use the latest JavaScript technology and frameworks client- and server-side.

With all these new technologies, the most important is to integrate them in the most efficient way and to create a very productive development experience. This article willl get you started step-by-step with Node.js technology.

13
1 3323
Question Jenna Makin · Mar 26, 2020

Hi-

I am trying to create a simple example of allowing binary (tiff) files to be selected and uploaded asynchronously to an IRIS for Health back-end.   I have managed to write the HTML and Javascript which works great with regular text / ascii files, but fails with binary files.

When I upload a binary file (tiff) image I get garbage like this on the database server 

^TKEN(5,"data")="MM"_$c(0)_"*"_$c(0,128)_"g ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ

5
0 2905
Question Đặng Phú Lộc · Mar 19, 2020

Hi everyone,

I have a javascript function in *.js file. This function has to access to variable set by server.

I've tried setting the variable in *.js like this;

function dummy(){

var myText = '#(myText)#';

}

However it seems like the webserver doesn't understand this coding convention. The js file sent back to client set myText in dummy() with the hard-value #(myText)#. It's not the value of myText variable in server side.

I know I can achieve this by putting dummy() directly in csp file. However I have to put dummy() in separated file, so that other files can use it.

My current w

3
0 730
Question Héctor Mancilla · Feb 6, 2020

Hi, I try to do a JS script into a csp page for a Workflow

The problem is that in Ensemble i don't had troubles but in Iris don't recognize even the console.log inside the script

I attach the code

   <form>
<table class="workflowtable">
<CSP:IF CONDITION='%task.%FormValues.IsDefined("montoDeposito")'>
<tr>
<td>
Monto Depositado:
</td>
</tr>
<tr>
<td>
<input type="text" 
name="montoDeposito"
value="#(%task.%FormValues.GetAt("montoDeposito"))#">
</td>
</tr>
</CSP:IF>
<CSP:IF CONDITION='%task.%FormValues.IsDefined("numFolio")'>
<tr>
<td>
Numero de Folio:
</td>
</tr>
<tr>
<td>
<input  type="text"
name="numFolio"
id=

2
0 500
Announcement Rob Tweed · Dec 7, 2019

Hot on the heels of the QEWD-JSdb announcement, QEWD-baseline provides a ready-to-run baseline environment for developing REST APIs.

The QEWD-baseline repository (https://github.com/robtweed/qewd-baseline) includes a fully-detailed tutorial on how to build RESY APIs using QEWD and the QEWD-JSdb database (running of course on IRIS).

https://github.com/robtweed/qewd-baseline/blob/master/REST.md

Included in the tutorial is:

- fully-worked examples, including how to integrate QEWD-JSdb's abstraction of the IRIS database 

- advice on debugging QEWD REST APIs

- how to use QEWD Sessions for use

1
0 321
Question Laura Cavanaugh · Nov 26, 2019

Hello community,

I recently added a change to our copy of zenutils.js, and while moving it up to production, I found  different versions of zenutils.js.  I edited a copy stored in the default directory for our web application  (e.g. c:\intersystems\DEV\CSP\{application}) but the file on production is stored in {install dir}\CSP\broker.

Where should this file live, and if it lives in the default dir for our web application, is that location used before CSP\broker?  We have way too many copies of this file, and the copy that I edited was out of sync with the version on production.  I'd like

1
0 428
Article David Crawford · Jul 31, 2019 2m read

IRIS provides us with anti login CSRF attack mitigation, however this is not the same as a CSRF attack, as login attacks only occur on the login form. There are currently no built-in tools to mitigate CSRF attacks on api calls and other forms, so this is a step in mitigating these attacks.

See the following link from OWASP for the definition of a CSRF attack:

https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)

The method shown in this article for mitigating these attacks is currently not proactive, but a minimum that needs to be combined with other attack vector prevention methods,

5
1 830
Question Thembelani Mlalazi · Apr 11, 2019

I have a query that I would like to  have refreshing at certain intervals lets say every 30 seconds with out refreshing the page content using the META TAGS

refreshes the whole page but I have a jquery function that will run at those intervals that I can use the problem is getting the jquery to call my COS function or is the way to do it with pure COS

<html>
<head>
<!--meta http-equiv="refresh" content="30"-->
<!-- Put your page Title here -->
<title>    Cache Server Page </title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/
libs/jquery/1.3.0/jquery.min.js"></scr
2
0 514
Article Nikita Savchenko · Feb 12, 2019 13m read

ˮ This is one of my articles which was never published in English. Let's fix it!

Hello! This article is about quite a practical way of developing InterSystems solutions without using the integrated tools like Studio or Atelier. All the code of the project can be stored in the form of "traditional" source code files, edited in your favorite development environment (for example, Visual Studio Code), indexed by any version control system and arbitrarily combined with many external tools for code analysis, preprocessing, packaging and so on.

The approach described in this article is suitable for












6
6 3237