In Rails framework, I need to call the lightbox to add payment method
by using javascript method AuthorizeNetPopup.openAddPaymentPopup().
But based on the design, the popup should be triggered by other ways
not by clicking the normal button.
For example, users click “signup” button, the server side can generate
ProfileID, Token, and send the Token to page, but right now how can I
automatically tirgger the AuthorizeNetPopup.openAddPaymentPopup()
method to open the popup?
If I can refer to Ajax, but how can I call the above method in .js
file?
I appreciate any idea or suggestion!!! Thank you very much in
advance!!!
In Rails framework, I need to call the lightbox to add payment method
by using javascript method AuthorizeNetPopup.openAddPaymentPopup().
But based on the design, the popup should be triggered by other ways
not by clicking the normal button.
For example, users click “signup” button, the server side can generate
ProfileID, Token, and send the Token to page, but right now how can I
automatically tirgger the AuthorizeNetPopup.openAddPaymentPopup()
method to open the popup?
If I can refer to Ajax, but how can I call the above method in .js
file?
There are many events that occur on a web page besides button/link click
events. It’s all depends on when you want the popup to show.
If you just need it to show when the page load then show the popup in
the “document ready” event.
Using JQuery:
$(function() {
// Show your popup here
});
Note: The above is short for…
$(document).ready(function() {
// Show your popup here
});
If you want the popup to happen on some other event besides the DOM
loaded event then you’ll need to bind your popup opening code to some
other event.