i want to start a online shop for that i want script from which users can buy via creditcard or paypal
JavaScript won't help. But you can have a look at this. https://www.paypal.com/IntegrationCenter/ic_pdnHome.html https://developer.paypal.com/
JavaScript is a browser based language and can't do any of that. However, you may want to have a loot at authorize.net or others.