oracle apex ajax,Oracle APEX AJAX calls fails

You probably have collated the code you used from some online sources.

It's old.

Since apex 4.2 we've had the apex.server.process function (apex 5.0 doc link) which will execute AJAX calls. htmldb_Get has been undocumented since ever and even if it would be, it'd be deprecated by now. And unless you use the async call on it, it's snchronuous. That's not what the first "A" in "AJAX" stands for. There is a reason browsers are alerting you in the console about how a synchronuous request is deprecated, just like there is a reason why apex 5.1 will no longer have some built-in sync calls such as in dynamic actions.

Prepare yourself for the future (which is now) and perform your calls as they should be. Don't teach yourself old junk.

apex.server.process("getLightRequirements"

,{pageItems:"#P1_PLANTS"}

,{dataType:"text"})

.done(function(pReturn){

alert("result is: " + pReturn);

})

Take note, apex.server.process by default expects JSON back. Either comply (shouldn't be hard) or tell it to expect text back.

Now, don't put javascript code in the "HTML page header" in script tags. Again, since 4.2 you can put javascript code in therefor-designed boxes on the page level.

Similarly, stop using these "onxxx" attributes. What point is there? Dynamic actions can easily help here and will visualize where you have JS going on. These "onxxx" attributes start ending up all over the place: in SQL, in attributes, in code,... It's a pest and it's detrimental to maintenance.

Create a dynamic action which acts on change of the required item. You can then execute javascript code, such as the code above, or call a function you've specified, or even execute PLSQL code from there. It's possible that in your case here it'd be possible to put everything in a dynamic action - unless you're doing this as a simple introductory exercise for example.

If you're still struggling, you may want to consider going to apex.oracle.com . Create a new workspace, then add a new account for which you can share the credentials. Create your application and page(s) as an example, and get back to us (or anyone) and share the workspace name + developer credentials. People can then go to your application and look around, copy things, change things,...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值