Solved

need some html/java code.

Posted on 1998-06-16
13
135 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
  • 6
  • 6
13 Comments
 
LVL 3

Accepted Solution

by:
bigelos earned 120 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 9

Author Comment

by:pcchiu
Comment Utility
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
Comment Utility
It works great now thanks alot.
0
 
LVL 3

Expert Comment

by:bigelos
Comment Utility
pcchiu,

No problem.  Glad you got it figured out.  Now you just need to come back and grade the answer...
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 9

Author Comment

by:pcchiu
Comment Utility
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
Comment Utility
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
Comment Utility
ok, my site can't run the scripts...
0
 
LVL 3

Expert Comment

by:bigelos
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks alot i'll try the new code soon.
0
 

Expert Comment

by:Eliza4321
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
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 …
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now