document is not defined

Inside iframe will be code that need url-parameters from the main page. But this is impossible to get the parameters because of different domains. So, I think of inserting the code right into dom from wixCode. The key problem is that it is not possible to add code without iframe at all. Like my own script for example ().
Or is it possible?