Solved

need some html/java code.

Posted on 1998-06-16
13
141 Views
Last Modified: 2010-04-09
I need sponsor to support my expense but no one willing to click the sponsor at all.  One time I saw a guy's homepage what he can do is make the people click all his sponsors before letting the people get in his page(his enter button will not enable unless all sponsor got clicked).  So I think it's a good idea to do that on my page to generate some click for my sponsor.
please email the code/example to funnyweb@hotmail.com if possible thanks.
0
Comment
Question by:pcchiu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
13 Comments
 
LVL 3

Accepted Solution

by:
bigelos earned 120 total points
ID: 1844211
OK,

I'll show you how using JavaScript.  You can also use cookies, but MSIE doesn't do cookies too well.
0
 
LVL 9

Author Comment

by:pcchiu
ID: 1844212
ok, you'll show me how to use it? but where and when and how I should get it?
0
 
LVL 3

Expert Comment

by:bigelos
ID: 1844213
OK,

Here is the code.  You can easily add more banners.  Just pass a higher number.  Of course, then you would have to change the (total > 2) to whatever it needs to be.  (You have to do a little math here.)

Hope it works for you.

<html>

<head>
<title>Homepage</title>

<script language="JavaScript">
var total=0;
function clicked(){
    total++;
}

function AllClicked() {
    // Change the total coresponding to 1 less than the total passed.  So, if only two banners, use 1
    // For 4, use 3, etc
    if (total > 2) {
         window.location="your_real_homepage";
    }
    else {
       alert('Please visit my sponsors first');
    }
}

</script>

</head>

<body>

<Center>
<a href="your_sponsors_address" target="_blank" onClick="clicked()"><img src="your_banner.jpg"></a>
<P>
<a href="your_other_sponsors_address" target="_blank" onClick="clicked()"><img src="your_other_banner.jpg"></a>
<P>
<a href="your_third_sponsors_address" target="_blank" onClick="clicked()"><img src="your_third_banner.jpg"></a>
<p>
<a href="JavaScript:AllClicked()" target="_top" >Enter</a>
</center>
</body>
</html>

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Author Comment

by:pcchiu
ID: 1844214
I tried the code and I only have 1 sponsor for now so I changed the number to (total > 0).  and only subtitute (one href up) before the javascript:allclciked().  But after I setup the page on the web and test it.  It keep asking to click the sponsor even I clicked the sponsor 10 times and 10 new window was opened...  What's going on?  am I miss something?  You code is easy to follow and seems work great if I can solve that problem.
0
 
LVL 9

Author Comment

by:pcchiu
ID: 1844215
It works great now thanks alot.
0
 
LVL 3

Expert Comment

by:bigelos
ID: 1844216
pcchiu,

No problem.  Glad you got it figured out.  Now you just need to come back and grade the answer...
0
 
LVL 9

Author Comment

by:pcchiu
ID: 1844217
One more thing, If the java code show on my page there's no point to use it since all browers can view the source by one click... Is there anyway to hide the java code?  For that I give out 20 more points...
0
 
LVL 3

Expert Comment

by:bigelos
ID: 1844218
Nope, sorry, can't hide your java code.  I can write you a Perl cgi script if you are able to run scripts on your site.
0
 
LVL 9

Author Comment

by:pcchiu
ID: 1844219
ok, my site can't run the scripts...
0
 
LVL 3

Expert Comment

by:bigelos
ID: 1844220
One thing you can do (since you only have 1 sponsor) is force all your users to open the link to your sponsor.  You can get rid of all the other javascript and just use this:

<a href="your_web_page" target="_blank" onClick="window.location='your_sponsors_web_page'">Enter Here!</a>

What this does is open your web page in a new window, and opens your sponsors web page in the window underneath it.  That way (especially if your sponsor counts the number of hits originating from your site) they will always visit your sponsor, but they won't see the page until they exit from your site.  If you want it the other way around, just swap your_page and your_sponsors_page around.


0
 
LVL 3

Expert Comment

by:bigelos
ID: 1844221
Having not tested the code above, the following might work better:
<a href="your_web_page" target="_blank" OnClick="window.location='your_sponsors_web_page'; return true;">Enter Here!</a>

Or even better yet,
<a href="your_web_page" target="_blank" OnClick="JavaScript:window.location='your_sponsors_web_page'; return true;">Enter Here!</a>

0
 
LVL 9

Author Comment

by:pcchiu
ID: 1844222
Thanks alot i'll try the new code soon.
0
 

Expert Comment

by:Eliza4321
ID: 1844223
Ok you say you need money like a paying banner  I am asking the same question I already have one paying banner and it is from cyber thrill here is the address and it pays 20 cents per click http://www.CyberThrill.com then once you have gotten there go to WebMasters Click for $$$ and then go to banners and you will know what to do from there on!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
CSS - Centering an image 2 27
CSS for <center> 14 35
HTML or/and CSS codes to construct numbered paragraphs. 5 21
Embedd an image or live dashboard into Slack 1 14
This article discusses how to create an extensible mechanism for linked drop downs.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question