SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Non-Member
    Join Date
    Nov 2005
    Posts
    187
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simple Javascript Help

    Here's my situation, I manage a html site using dreamweaver and dreamweaver templates. When I want to modify a sitewide ad, I have to change the template and then reupload all the files which is annoying. I was wondering if there is a way (using javascript or something else) that I could grab the google adsense data and other ad data from an external file. I don;t think Iframes would work so I was wondring if maybe I can grab the info from a .js file using javascript or something.

    So can anyone tell me how to grab data from a .js file and print it out in a html file? Or if there's an easier way, let me know.

    Cheers!

  2. #2
    Non-Member
    Join Date
    Nov 2005
    Posts
    187
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    anyone?

  3. #3
    SitePoint Wizard bbolte's Avatar
    Join Date
    Nov 2001
    Location
    The Central Plains
    Posts
    3,304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    copy/paste your ad code into a blank page (no html) and save it with an extension of .js (myad.js). you don't have to put the script tags in the .js file. at the place in each document where you want the ads to show, put

    Code:
    <script src="myad.js"></script>
    make sure that you have the path to the script correct. HTH...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •