jQuery in page

jQuery in page

I am connecting my site to an external API cross browser.

I have all my code in the page instead of linking it to an external .js file. 

I have all my code and functions as without using a framework i'm starting to get alot of undefined variables so to avoid this i'm just structuring my code in one script tag (neatly).

I just want to know if this is ok? Does it really matter if your code is exposed like this? I guess it does not matter as it is client side anyway right and i'm just reading data?