1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Getting the pubID from XML and placing it into the adsense javascript code using XSL

Discussion in 'JavaScript' started by fcmisc, Aug 3, 2005.

  1. #1
    Hi,

    I'm writing a new site. The content is all in XML and I'm formatting it with XSL. What I'd like to do is to have different adsense pub ID's for different pages, so that I can put an author's adsense ID on a page that they've written.

    However, I don't know how to get the adsense ID ,from an XML node, into the javascript variable that's used by the adsense code.:confused:

    Does anyone know how to do this?

    Thanks,

    fcmisc.
     
    fcmisc, Aug 3, 2005 IP
  2. anotherchancetosee

    anotherchancetosee Guest

    Messages:
    53
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Wouldn't you be able to write out a CDATA section with the XSL transformation and drop it in where appropriate? Are you doing the transform server or client side?
     
    anotherchancetosee, Aug 3, 2005 IP
  3. fcmisc

    fcmisc Active Member

    Messages:
    701
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    93
    #3
    Thanks for the tip. I'll look up that CDATA tomorrow as it's getting late.

    I'm not sure whether or not to do the transform on the client or server. I've tried sticking adsense into a crude template. But it doesn't work in IE unless I pull out the <!-- and -->. But if I do that the whole page is blank in Netscape.

    ARRRGGGHHHH!!!

    I am therefore starting to lean towards server side transforms.
     
    fcmisc, Aug 3, 2005 IP