greetings, fellow internet!

welcome to digitalgangster.com, the coolest community for people who hack the gibson and make bajillions of dollars off of online marketing. this version of the forum is in view only mode for archival purposes. the new forum can be found here.

ASGPHE,
ytcracker, original digital gangster
follow me on twitter
fan me on facebook
Results 1 to 19 of 19

Thread: Javascript

  1. #1

    Default Javascript

    How do I make a javascript timer that locks an intro page for 30 second so that visitors can't click "Enter" until the 30 second timer is finished counting down. the 30 second timer needs to be visible on the page.

  2. #2
    arpz's Avatar
    Join Date
    Feb 2010
    Location
    England, UK
    Posts
    1,298

    Default

    http://www.jquery4u.com/tag/jquery-page-lock-timer/

    Maybe try something like this in jQuery.

    ~~jUsT tURnEd ReD mAnDEMz~~

    1DFdpU6nPcMnK8db2SnKPM8HTCXsFThHVz
    i move ecstasy in envelopes, that's what i call e-mail


  3. #3

    Default

    thanks thats almost what i'm looking for. need the page enabled w/ timer at the bottom that enables enter link after 30 seconds.

    i dont know javascript/have time to fuck with javascript.

  4. #4

    Default

    I meant lock an "enter" link, not the whole page. my mistake nigger.

  5. #5
    Synja's Avatar
    Join Date
    Jan 2009
    Location
    727
    Posts
    3,644

    Default

    Easiest way is to create the button, set it as disabled, and have a JS timer that removes the disabled attribute.
    Code:
    <body onload = "setTimeout('enable()', 30000)">
    <input type = "button" id = "enter" value = "disabled" onclick = "*whatever it needs to do*" disabled>
    <script type = "text/javascript">
    function enable()
    {
    var x = document.getElementById("enter");
    x.removeAttribute("disabled");
    }
    setTimeout("enable()", 5000);
    </script>
    This also helps eliminate scripting restrictions by requiring them to allow your site/page before they can hit the button if they have noscript or anything similar.

    Of course, add something in there to let the user know that they need to enable JS, etc... Maybe add a visible timer.
    Quote Originally Posted by tm View Post
    i will love your sweet body forever
    Quote Originally Posted by khamkookeomany View Post
    Red curtain boy , help me please, i am new number, i try to sign in www.gayhentaixxx, but it is not woking.... help me pleasemmmmmmmmmmmmmmmmmmm

  6. #6

    Default

    Just what I was looking for, thanks.

    How do I make this code display the seconds counting down on the page?

  7. #7
    ionbladez's Avatar
    Join Date
    Dec 2009
    Location
    where u at nigga
    Posts
    4,666

    Default

    Quote Originally Posted by Synja View Post
    Easiest way is to create the button, set it as disabled, and have a JS timer that removes the disabled attribute.
    Code:
    <body onload = "enable()">
    <input type = "button" id = "enter" value = "disabled" onclick = "*whatever it needs to do*" disabled>
    <script type = "text/javascript">
    function enable()
    {
    var x = document.getElementById("enter");
    x.removeAttribute("disabled");
    }
    setTimeout("enable()", 5000);
    </script>
    This also helps eliminate scripting restrictions by requiring them to allow your site/page before they can hit the button if they have noscript or anything similar.

    Of course, add something in there to let the user know that they need to enable JS, etc... Maybe add a visible timer.
    using synja's code, here is one that counts down
    Code:
    <html>
    	<head>
    		<script type="text/javascript">
    			var c=30; // number of seconds to count down from
    			var s=''; // leave this alone lol
    			function enable() {
    				var x = document.getElementById("enter");
    				if(c!=0){
    					c==1 ? s='Wait ('+c+' second)' : s='Wait ('+c+' seconds)';
    					x.value=s;
    					c--;x
    					x.setAttribute("disabled","true");
    					setTimeout("enable()", 1000);
    				} else {
    					x.removeAttribute("disabled");
    					x.value="Enter";
    				}
    			}
    		</script>
    	</head>
    	<body onload="enable()">
    		<input type="button" id="enter" value="." disabled="disabled">
    	</body>
    </html>
    have fun
    Last edited by ionbladez; 03-16-2012 at 04:08 PM. Reason: quick fix

    DG p0kEm0n SqUaD 2k11
    please use this name on aim or skype. also i code bots.

  8. #8

    Default

    Making people wait X number of seconds watching advertisements (instead of filling out surveys and zip submits) before they can access content is a great idea. I wonder if there are any ad networks out there that would be down for something like that?

  9. #9
    Synja's Avatar
    Join Date
    Jan 2009
    Location
    727
    Posts
    3,644

    Default

    Quote Originally Posted by fr0st View Post
    Making people wait X number of seconds watching advertisements (instead of filling out surveys and zip submits) before they can access content is a great idea. I wonder if there are any ad networks out there that would be down for something like that?
    I'm sure there are, since this is what Stickam (sortof), Youtube, and numerous other free content sites are doing. I haven't seen any smaller sites with that type of ad yet so I don't think it's hit mainstream affiliate programs, at least not without purely being a PPC program.
    Quote Originally Posted by tm View Post
    i will love your sweet body forever
    Quote Originally Posted by khamkookeomany View Post
    Red curtain boy , help me please, i am new number, i try to sign in www.gayhentaixxx, but it is not woking.... help me pleasemmmmmmmmmmmmmmmmmmm

  10. #10

    Default

    bitch nigga listen.

    i am not making people wait x number of seconds watching advertisements.

    what i am doing is going to make me $4,500 dollars which I am going to use to go to a place where I am able to successfully repair my psychological foundation and create a work of art that tells the truth about who I am, what happened, when it happened, how it happened, everyone involved, and a long list of others.

    thanks for the code it works perfect. i wish there was a way to do this shit in php or html.

    is there a way to accomplish the same thing in php or html? someone told me no and that javascript was needed.

    thats fucking bullshit, how could php - one of the best languages and most capable languages out there - not be able to set a fucking timer on a page that disables a link/button until the countdown is finished.

    seriously.

    are you fucking telling me that fucking php can't fucking do a fucking timer lock with a button on a link?

    /drunk

  11. #11
    Synja's Avatar
    Join Date
    Jan 2009
    Location
    727
    Posts
    3,644

    Default

    Quote Originally Posted by mech View Post
    bitch nigga listen.

    i am not making people wait x number of seconds watching advertisements.

    what i am doing is going to make me $4,500 dollars which I am going to use to go to a place where I am able to successfully repair my psychological foundation and create a work of art that tells the truth about who I am, what happened, when it happened, how it happened, everyone involved, and a long list of others.

    thanks for the code it works perfect. i wish there was a way to do this shit in php or html.

    is there a way to accomplish the same thing in php or html? someone told me no and that javascript was needed.

    thats fucking bullshit, how could php - one of the best languages and most capable languages out there - not be able to set a fucking timer on a page that disables a link/button until the countdown is finished.

    seriously.

    are you fucking telling me that fucking php can't fucking do a fucking timer lock with a button on a link?

    /drunk
    Has to be done client side. It's not a question of language, PHP *can* do it, it just can't do it in the right place.
    Quote Originally Posted by tm View Post
    i will love your sweet body forever
    Quote Originally Posted by khamkookeomany View Post
    Red curtain boy , help me please, i am new number, i try to sign in www.gayhentaixxx, but it is not woking.... help me pleasemmmmmmmmmmmmmmmmmmm

  12. #12

    Default

    so what you are saying is that if i open a new .html file there is no piece of php code that i can put into the file that will accomplish the same thing that the javascript code does in a way where all i have to do is upload the .php or .html and it will work the same as the javascript code???

    ?

  13. #13

    Default

    also did not mean any disrespect by calling you bitch nigga my nigger.

    its how i express love. you know what i'm saying, bro.

  14. #14

    Default

    so when i say you're a fucking faggot, what i really mean to say is thanks man.

    im emotionally scarred man its not my fault im sorry for real.

  15. #15
    Synja's Avatar
    Join Date
    Jan 2009
    Location
    727
    Posts
    3,644

    Default

    PHP executes on the server, JavaScript executes within the browser.

    Any effects, timers, or realtime interactions with the user have to be done within the browser. You don't have to use JavaScript, you can use anything that runs within the browser.... JavaScript is just the most convenient method. The user can't see PHP, ASP, or any other server side language until after the code has executed.... in fact, the browser won't see the script at all, just the output of the script in most cases.
    Quote Originally Posted by tm View Post
    i will love your sweet body forever
    Quote Originally Posted by khamkookeomany View Post
    Red curtain boy , help me please, i am new number, i try to sign in www.gayhentaixxx, but it is not woking.... help me pleasemmmmmmmmmmmmmmmmmmm

  16. #16

    Default

    another quick question,

    is there a way to make two check boxes "yes" and "no" with a button that will go to google.com if the "yes" is checked or go to www.aol.com if the "no" is checked? with HTML? I don't want to have to code up a cgi or php function, but there does not appear to be an 'if' or 'then' in html.

  17. #17

    Default

    nevermind i figured it out.

  18. #18

    Default

    Quote Originally Posted by fr0st View Post
    Making people wait X number of seconds watching advertisements (instead of filling out surveys and zip submits) before they can access content is a great idea. I wonder if there are any ad networks out there that would be down for something like that?
    Agreed, this is a great alternative to surveys & submits. I'll toss the idea around to some networks and see if anything can be put together.

  19. #19
    Synja's Avatar
    Join Date
    Jan 2009
    Location
    727
    Posts
    3,644

    Default

    Quote Originally Posted by Crazy View Post
    Agreed, this is a great alternative to surveys & submits. I'll toss the idea around to some networks and see if anything can be put together.
    I've seen this done on everything from YouTube to Stickam, several sites that use streaming content use this method. I just haven't seen anything like this offered by any networks I've done business with. I'd be interested in doing this sort of thing.
    Quote Originally Posted by tm View Post
    i will love your sweet body forever
    Quote Originally Posted by khamkookeomany View Post
    Red curtain boy , help me please, i am new number, i try to sign in www.gayhentaixxx, but it is not woking.... help me pleasemmmmmmmmmmmmmmmmmmm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •