I want to make a seperate file for Adsense or YPN so that I can include the file on each page, but when I want to make changes to the code, I would only need to access one file. That way I would not have to change 200+ pages. I thought I could paste my adsense code into notepad and name it with a .js extension, upload that file to my website, and then add this code into my webpage: <script language="javascript" type="text/javascript" src="filename.js"></script> When do that it does not pull the adsense code onto the page. Can someone tell me what I am doing wrong?
the problem is that if you copy the text from adsense straight in, you will have the <script ...> in your .js file and this is why it doesnt work. Best way is using something like PHP or ASP to server side include the adsense code. If you still want to use JS to include it then you would so something like this: <script language="javascript" type="text/javascript" src="filename.js"></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> and in filename.js put only the text google provides you between the first <script> </script>: google_ad_client = "XXXXXXX"; ... google_color_text = "000000";