[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

need some html/java code.

Posted on 1998-06-16
13
Medium Priority
?
144 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 480 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

650 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