The function with ajax request sends data from the server.

function load3(){ $.ajax({ type: 'POST', url: 'action.php', data: { 'type': 'graf', }, success: function(data) { var obj = jQuery.parseJSON(data); if('success' in obj){ var xz = obj.x; var yz = obj.y; } console.log('ajax'+xz); console.log('ajax'+yz); var point = new paper.Point(xz,yz); console.log('point'+point); path.lineTo(point.add([xz,yz])); } }); } 

The data comes true, but in the creation of the very point "y" for some reason it is ignored and instead of it rises "x". The console displays c ajax 150.90 for example, and the variable point (150,150)

    1 answer 1

    solved the problem directly by sending data here

     path.lineTo(point.add([xz,yz]));