: Legalizing an internal hyperlink with adsense I think the problem with me making money with adsense is the way my links are crafted. Here's an example in code of how I crafted a link on my
I think the problem with me making money with adsense is the way my links are crafted.
Here's an example in code of how I crafted a link on my mobile site for the second image in the image viewer. Assume the image fills the height of the screen minus the height of the anchor tag boxes (which is explained below):
<div ID="imageviewer">
<img src="picture-2.jpg">
</div>
<span ID="Navigation">
<a href="image-1" ID="L">Last</a> <a href="image-2#FB" onclick="shareinnewwindow()" ID="FB">Share</a> <a href="image-3" ID="N">Next</a>
</span>
<!-- adsense code here -->
Then in CSS, I make the anchor tags boxes of normal button size and apply proper background images to each.
Here's where my problem is. Currently if I select the share button, the new window opens and sharing works but the original screen shifts so that the buttons are at the top of the screen with the advertisement moved up.
I then modified the code as follows:
<div ID="imageviewer">
<img src="picture-2.jpg">
</div>
<span ID="Navigation">
<a href="image-1" ID="L">Last</a> <a href="image-2#imageviewer" onclick="shareinnewwindow()" ID="FB">Share</a> <a href="image-3" ID="N">Next</a>
</span>
<!-- adsense code here -->
As soon as I made that modification, my adsense RPM went up a few cents.
This makes me think that by adding the labels to the end of the urls, I'm missing out on income, but if I don't add labels then the same page reloads. For example, if I had code like:
<a onclick="runscript()" href="page">click me</a>
then when that link is clicked, the page is then reloaded while the script is being run. I tried to avoid the loading via code like:
<a onclick="runscript()" href="page#here" ID="here">click me</a>
But adsense doesn't like it probably because of unwanted jumpiness?
So my question is, How can I make adsense happy and at the same time add labels to the end of the URL defined by href so that the page doesn't reload in the background?
P.S. I almost put this in the programming forum but I didn't because it has to do with the operation of my website and I'm looking for more of what is acceptable from adsense's point of view. For example, do I need to make my link reference a tag with a certain ID a certain number of pixels up from the link? etc.
More posts by @Nickens628
1 Comments
Sorted by latest first Latest Oldest Best
To prevent the page from reloading you simply need to return false; from your runscript function:
function runscript(){
....
return false;
}
That will prevent the link from actually triggering the href when the JavaScript handles the action instead. There will be no jumpiness and the page will not reload.
If you can't edit the function itself, you can do so in the HTML onclick instead:
<a onclick="runscript();return false;" href="page">click me</a>
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.