Quote Originally Posted by kuroi View Post
- -
PHP runs on your web server, whereas javascript runs in your visitors' browsers. So you can insert a call to load javascript in your PHP (though Zen Cart has better ways to do this, documented in the docs folder that comes with the download), but you need an event in the visitors' browser to trigger its execution such as a page loading or a button being clicked.

Also, since not everybody has javascript turned on, your payment module needs to function even without the javascript. The javascript should really be used only to improve the user experience, not to deliver it.
Thanks Kuroi!

Unfortunately the payment provider has built their system in a way that it does require the javascript in order to function. Of course most of people does have it enabled but I do agree with you although can't help it now.

I found out that the javascript can be put to folder includes -> modules -> pages -> checkout_confirmation and so far looks promising. Now we just need to build the payment module again (we have several other tries for this module already earlier).

How do we limit that the javascript won't load using all different payment methods. We realised that now it loads even if choosing "money order". So we need to get some if sentence that only when choosing this payment method it loads else not. How can I tell to the system this?