/    Sign up×
Community /Pin to ProfileBookmark

PLease look at this!

Again, I would like you to look at this item mentioned previously to see if anyone can help me figure out “How they did it…”

Hi, I’m new here – this is my first post on this forum- so first of all hi to everyone!

My question:

This site:

[url]http://www.foodnetwork.com/food/cooking[/url]

has adsense ads (lower right column) that open up in a new browser window! This is very interesting and useful and I would like to know how they did it.

I checked the source code, (no google code in the html) disabled javascript and the ads were gone.

So since the extent of my knowledge of Javascript is ctrl-c & ctrl-p, I figured I needed some javascript experts to tell me how they do it.

Please take a peek at it, and let me know if you know what their doing to get the ads to appear with javascript and open in a new window when clicked on.

(you don’t have to click on them – it doesn’t go into my pocket, I wish it did…)

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@balloonbuffoonFeb 26.2005 — Are you wondering how to get Adsense Ads? Then you would need to contact google to sign up for an account and they will tell you how to get them on your page. If you are looking for how to do this with your own ads you would just place an image in <a> tags with the href is what to link to and target is "_blank". Like so:

<i>
</i>&lt;a href="http://link.com" target="_blank"&gt;&lt;img src="ad.jpg"&gt;&lt;/a&gt;


-Steve
Copy linkTweet thisAlerts:
@myblueshoesauthorFeb 27.2005 — No, I'm not sure you understood the question Steve...but at least you tried to answer it.


The isuue is not knowing how adsense works, having an account, or having links open in a new browser window,

The question pertains to having an adsense ad open in a new browser window.

Click on any adsense ad, and you'll notice that the Publisher site which hosts the ad will be gone- replaced by the advertiser who pays google- (try it on as many sites as you want to prove it to yourself if you are curious to see what I am talking about.)

thev visit the link in the original question I posted. Click on the google ad. Notice it opens in a new window.

THis is done with javascript. I want to know how.

Thanks for your post.
Copy linkTweet thisAlerts:
@JPnycFeb 27.2005 — I don't understand the question either. If all you want to do is have a link open in a new window, put target="_blank" inside the <a> tag.
Copy linkTweet thisAlerts:
@myblueshoesauthorFeb 28.2005 — Understanding my question requires having an adsence account, using their code and understanding the behavior of that code from experience. (The proprietary code - unlike many affiliate links- conrtains no <a href=...""></a> tag in it. (It is a propriatary script supplied by Google, which cannot be altered.) Hence, there is no place to add target="_blank" or anything eqivalent to my knowledge.

Yet, following my direction above - by visit sites- you will see that I have found a site that has banners from Adsence that behave differently and looking at the source code, where the actual ad script is not even in the page...

That's understanding it for the sake of satisfying everyone's curiosity what I'm talking about. Answering this question requires another skill set- reading code.

(Not to be rude or anything- I appreciate the responses- but I think this is a question is beyond the scope of basic level web designers. This is a challenging question for those who read code like I read the cooking directions on a can of soup. THey must know some heavier programming languages and javascript well to reason out how this trick was pulled off....)
Copy linkTweet thisAlerts:
@SpectreReturnsFeb 28.2005 — It seems that they have JavaScript to write the ads in, and then hook them up to onClick() handlers, so when you click them they open the window. This can be done with "window.open(url,title,parameters)".
Copy linkTweet thisAlerts:
@myblueshoesauthorFeb 28.2005 — SO ....can you expand on that a bit?

If Javascript writes in the code, is that pulled from a database or another server side file? How is that typically done?

Can I view the file on the server side to see how they set it up?
Copy linkTweet thisAlerts:
@SpectreReturnsFeb 28.2005 — I honestly have no idea how it's done, as I've never used the google ads. Sorry to be unable to help.
×

Success!

Help @myblueshoes spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...