在javascript中单击“取消交友”按钮后提交表单

时间:2018-08-05 04:04:22

标签: javascript php html css

在我的项目中,我添加了一些JavaScript,以避免用户多次单击按钮。它有一个页面从注册页面中提取数据。我按下了const latLngToVector3 = (latLng, radius) => { const phi = Math.PI * (0.5 - (latLng.lat / 180)); const theta = Math.PI * (latLng.lng / 180); const spherical = THREE.Spherical(radius || latLng.radius || 1, phi, theta); return new THREE.Vector3().setFromSpherical(spherical); }; const vector3ToLatLng = (v3) => { const spherical = new THREE.Spherical().setFromVector3(v3); return { lat: 180 * (0.5 - (spherical.phi / Math.PI)), lng: 180 * (spherical.theta / Math.PI), }; }; // convert to x,y,z with radius = 1 const v3 = latLngToVector3({ lat: -16.8985, lng: 145.7134 }); // convert back to lat/lng const latLng = vector3ToLatLng(v3); add按钮的每个数据行(禁用)。用户单击unfriend后,将出现提示框,要求用户输入主题并单击add。单击ok后,将可以单击ok按钮。在这里,我的问题是,一旦单击unfriend按钮,就会出现提示,单击add后,数据不会插入数据库。如果单击ok按钮,它将插入数据库。我希望每当用户单击unfriend按钮时提交数据。我认为这是因为此表单有两个提交按钮,但我不知道如何区分按钮。这是代码:

add

0 个答案:

没有答案
相关问题