Categories
Mastering Development

ERR_NAME_NOT_RESOLVED when making ajax call to sap RFM in Cordova app on Android using SAPUI5

This is my first question and I’m quite new to sap development, so I hope I can make this clear enough. I’m trying to make a call to RFC from an Android app. I created the function module on my company’s SAP system and then exposed it as SOAP web service. Then I wrote a […]

Categories
CMS Mastering Development Wordpress

How to prevent multiple post with same meta value being created simultaneously in WordPress (with ajax)

I’m trying to make my own appointment system for WordPress. For this, I created a post type called "appointments". When users select a service from the service list, the available dates and times are listed. When the available date and time are selected and the appointment is created, a meta key named "appointment_datetime" is added […]

Categories
Mastering Development

JSON Object return path in data [closed]

I’m facing some errors in php. I’m using $.ajax to send datas to a PHP APIs and PHP APIs is supposed to return a JSON Object but it return something else. This is what I have /var/www/html/eagence/simulateur_puissance{"error":false,"message":"Success","data":{"power":5,"montant":"6210","branchement":1,"puissanceTotal":0.24,"puissanceUtil":{"id_code":"1","id_code_tarif":"01","type_branchement_id_type_branchement":"1","id_puissance_soucrite":"1","valeur_puissance_soucrite":"1.1"},"infoAgence":false}} My ajax fonction : $.ajax({ url:"/simulateur_puissance/api/api", type: ‘POST’, data: {summaryApp: JSON.stringify(devicesMap), usage: $("#usage").val()}, success: function(data, statut){ console.log(data); }, […]

Categories
Mastering Development

Ajax function inside a second Success function is not being called

I am working with DataTables library where i need to make consecutive AJAX requests. Problem is that the AJAX function inside the second Success function is not being called. Here is the whole code $(document).ready(()=>{ $.ajax({ url: ‘http://localhost:3000/api/post/getUserData’, method: ‘post’, dataType: ‘json’, data: { "email": window.email, "token": window.token }, success: function(data){ // <———————–FIRST SUCCESS FUNCTION […]

Categories
CMS Mastering Development Wordpress

What is the correct way to call a PHP Function with multiple parameters from the AJAX Handler?

Q: What is the correct way to call a PHP Function with multiple parameters from the AJAX Handler? Q: Am I calling the php function correctly? Page Element The user clicks a button. Action: The click should connect to an external server using the following params: User Name 2. IP Address 3. Port 4. Public […]

Categories
Mastering Development

How to get all checkedboxes in a manual POST

A bit of background, I mainly work in .Net/C# and never did any PHP my whole life and my company gave me an existing PHP code and asked me add some feature to it. The webpage I need to work on is a catering system. The page recalculates the total price when there are changes […]

Categories
Development

yii2-formwizard change model after select2 selection

I’m trying to implement a multiple models form using the form-wizard widget, with Profile as main model and few others as linked ones. When I select the entity type field for the main model, I would like to change the linked model for the next step, basing on the value of entity type field. I […]

Categories
CMS Development Drupal

Updating entities/posting data via ajax?

I’ve got a handful of entities that need to updated on user interaction, such as: Tracking user progress through a video, such that a listener checks playhead position every x seconds and posts information to an entity containing data on that user’s progress on that video. A collection of checkboxes that, when clicked, automatically update […]

Categories
AJAX Development jQuery

Why jquery ajax post request get error in yii2?

js: $.ajax({ url: ‘/site/updateuserdata’, method: ‘POST’, //async: true, //cache:false, data: { ‘type’: ‘sort’ //val: val //csrfParam: csrfToken }, dataType: ‘text’, error: function(jqXHR, textStatus, errorThrown) { alert(‘error by ajax’); }, success: function(data, status, jqXHR) { alert(‘success by ajax’); } }); Controller: public function behaviors() { return [ ‘access’ => [ ‘class’ => AccessControl::className(), ‘rules’ => [ […]

Categories
Chrome Development

express API endpoint works when testing with Talend but will not work on its own from chrome extension

Using Talend API, a api tester, I am able to successfully use the endpoint written with Express However, when attempting the same POST request from my chrome extension, I get 404! jQuery.ajax ({ url: “http://somewhere.com/api/v1/login/”, type: “POST”, data: JSON.stringify({email:”asf@as.com”, password: “asdf”), contentType: “application/json”, success: function(data, status){ alert(“Data: ” + data + “\nStatus: ” + status); […]