Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
172 views
in Technique[技术] by (71.8m points)

Stop multiple requests, send only one javascript

I'm working with payment first time and if someone could give me advice I would appreciate. I have this situation:

If credit cards are saved, I'm getting back from service those cards (new iframe with filled data) where user can choose with which one he will pay. . The problem is when I click on pay button , the number of sent requests to the server is how many times i've clicked to change card (if I change card).

Before this problem, I had another , every time I click to change card (among saved cards), service creates new iframe with filled data, but it doesn't clear previous one., so I had to remove childNode with an old iframe (so user can see only one filled form of selected card) ..so I assume that it isn't removed even if in inspect form there is only selected iframe .. I've tried with stopPropagation(), but no luck, and with stopImmediatePropagation() console log is only one time instead multiple which is okay, but then I can't sent request. I'm not sure if I explained well, hope I will find some answers.. payment service I'm using is called Monri, and my client doesn't want to change it.

question from:https://stackoverflow.com/questions/65602968/stop-multiple-requests-send-only-one-javascript

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...