Ajax calling in Oracle Application Express (APEX 4.2)

Source: Internet
Author: User

Ajax calling in Oracle Application Express (APEX 4.2)

Oracle Application Express 4.2 (APEX 4.2) is a quick Web Application development tool. Ajax requests are sometimes used during web page development.

How to create an ajax request:

1. Create background processing:

Step 1

Step 2

Step 3

In this way, the background processing is completed.

2. Compile js on the frontend:

Function ajaxTest (){
Apex. server. process ('test', // name of the background processing, case sensitive
{}, // Parameters to be passed
{
DataType: 'text ',
Success: function (data ){
Console. log (data );
}
}
);
}
AjaxTest ();

In this way, the console outputs hello world.

PS:

If you want to pass parameters, you can do this:

Apex. server. process ('test', // name of the background processing, case sensitive
{
// The x01-x10 is a public variable built in apex that can pass General strings.
X01: 'param1 ',
X02: 'param2 ',
...
X10: 'param10 ',
// If there are many variables to be passed and the types are the same, you can use an array
F01: ['param1', 'param2',...],
F02: [...]
},
{
DataType: 'text ',
Success: function (data ){
Console. log (data );
}
}
);

Plsql reference in background processing

Declare
Rochelle str1 varchar2 (20 );
Rochelle str2 varchar2 (20 );
Begin
Rochelle str1: = apex_application.g_x01;
Rochelle str2: = apex_application.g_f01 (1); -- note that the start of plsql numbers is 1.

End;

This article permanently updates the link address:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.