Hi all,

I'm officially baffled.

We wanted to add Google Adsense to at least one of the tabs in the app, if
the user is using the 'free' version.

So I dutifully follow the example 'cu bart' set out in one of his postings
(thanks!) but I don't see the ad in the browser.

Now, I'm not a JavaScript expert (nor even knowledgeable when it comes down
to it.) but it looks like I may need to fire the script off somehow.

I checked in Firebug and the code is definitely there, with proper CR and
quotes.  I placed a dummy string just after the JS and am seeing it in the
browser.  If I inspect the HTML in Firebug, and expand the generated span, I
see the 2 scripts, the first one expands to the code expected. The second
(call to show_ads.js, I presume) expands to "1".

Here's what I've got:

NewAccountWidget::NewAccountWidget(WContainerWidget *parent):
WContainerWidget(parent)
{
        // create a bunch of controls first
                :
                :
        new WBreak(this);
        if (usr.m_nRegLevel == 0) {
                WText *GoogleAd = new WText( 
                        L"<script type=\"text/javascript\"><!--\r\n"
                        L"google_ad_client = \"pub-7......2\";\r\n"
                        L"/* Main Site */\r\n"
                        L"google_ad_slot = \"0...7\";\r\n"
                        L"google_ad_width = 468;\r\n"
                        L"google_ad_height = 60;\r\n"
                        L"//-->\r\n"
                        L"</script>\r\n"
                        L"<script type=\"text/javascript\"\r\n"
        
L"src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\";>\r\n"
                        L"</script>\r\nDUMMY TEXT<br/>", 
                        XHTMLUnsafeFormatting, this);
                new WBreak(this);
}
}

Could it be because the ad is in a widget that is in a tab?

Created as such:

TeBROnline:: TeBROnline (const WEnvironment& env)
                : WApplication(env),
                messageBox_(0)
{
        :
        Menu[aa++] = menuLogin->addItem(WString::tr("CreateAcc"),
deferCreate(boost::bind(&TeBROnline::pgCreateAcc, this)),
WMenuItem::PreLoading);
        :
}


WWidget * TeBROnline::pgCreateAcc()
{
        NewAccountWidget *result = new NewAccountWidget();
        :
        // some setup
        :
        return result;

}

Thanks in advance for any tips or insight.
-Jim

------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to