I'm signing up an affiliate and they requested some JavaScript to go into certain pages. Can you let me know how and where to insert such code?

Scripts are not allowed in the editors for page content, product content, or category content; CSS and HTML are allowed, but scripts will be stripped out by the system. There are two places that do allow scripts, though: the share script area and the HTML head area; both of those are edited in Admin > Site > Site Name > Settings > "SEO / HTML" tab.