/    Sign up×
Community /Pin to ProfileBookmark

Simple alert box question…

Will an alert box stop everything loading until the ok box is clicked?
If it does, that is what I need.
What would be a simple code for putting an alert box, just to
delay the page ?
Can it go anywhere in the html code, or does it have to be before head, body, etc?
Thanks!

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@UltimaterApr 20.2005 — LOL... True, an alert dialog box does entirely stop the page, but once the alert is clicked, the script continues where it left-off as though the alert had never happened.

If you are trying to fire a function after the page's elements are written, you can use the [color=royalblue]onload[/color] function.

If you want to display a loading layer on-top-of the whole page's contents and hide the layer after the page finishes loading, then you can use this:
[code=html]
<div style="position: absolute; top:0px; left:0px; z-index: 9999; display: inline; background-color: buttonface; height:9999px; width:9999px;" id="loader">
Loading
</div>
...MORE...
...HTML...
...GOES...
...HERE...
<script type="text/javascript">
setTimeout('document.getElementById("loader").style.display="none"',100)
</script>
[/code]
Copy linkTweet thisAlerts:
@stc60authorApr 20.2005 — Thanks! I know it may sound crazy, but I need some type of

"human" involvement before going on, and a click would be just enough.

Here is the script in where I need it to go:

<script language="Javascript">

parent.score=parseInt((parent.score+<?print $cr;?>)*10);

parent.score=(parent.score)/10;

parent.topFrame.document.form1.score.value=parent.score;

****
parent.ida[1]=<?print $id1;?>;

parent.ida[2]=<?print $id2;?>;

parent.url[1]="<?print $url1;?>";

parent.mainFrame.location.href="<?print $url1;?>";

</script>

Exactly what I would like is something where the 4 stars are to evaluate the

parent.score and if the parent.score is greater than or equal to 100, I

would like an alert box to popup and stop everything before going on.

This script is in an autosurfing script and I would like some sort of way

of stopping the autosurfing until someone clicks.

That way, nobody can let it go for hours.

I am not sure if I am able to make it as understandable as I would like.

Could I just add the following in that space:

if (parent.score >= 100)

{

window.alert("Click on to continue surfing");

}
Copy linkTweet thisAlerts:
@UltimaterApr 20.2005 — That looks like it will do it. If that doesn't do it, you can always make the alert pop-up on the parent-side like:
<i>
</i>if (parent.score &gt;= 100)
{
parent.window.alert("Click on to continue surfing");
}

Copy linkTweet thisAlerts:
@pummankMay 11.2005 — Thanks! I know it may sound crazy, but I need some type of

"human" involvement before going on, and a click would be just enough.

Here is the script in where I need it to go:

<script language="Javascript">

parent.score=parseInt((parent.score+<?print $cr;?>)*10);

parent.score=(parent.score)/10;

parent.topFrame.document.form1.score.value=parent.score;

****
parent.ida[1]=<?print $id1;?>;

parent.ida[2]=<?print $id2;?>;

parent.url[1]="<?print $url1;?>";

parent.mainFrame.location.href="<?print $url1;?>";

</script>

Exactly what I would like is something where the 4 stars are to evaluate the

parent.score and if the parent.score is greater than or equal to 100, I

would like an alert box to popup and stop everything before going on.

This script is in an autosurfing script and I would like some sort of way

of stopping the autosurfing until someone clicks.

That way, nobody can let it go for hours.

I am not sure if I am able to make it as understandable as I would like.

Could I just add the following in that space:

if (parent.score >= 100)

{

window.alert("Click on to continue surfing");

}[/QUOTE]


Hello stc60,

I also need that alert box as I am running an Autosurf Site and the members of my sites surfing all day which costs me very expensive Hosting charges.

I want to stop the members after they visited 100 sites whether its a unique or repeat hit.

Please tell me the full code and how to set it in my surf.php or surfbar.php, plz reply asap as I need it urgently

Thanks

Pummank
Copy linkTweet thisAlerts:
@stc60authorMay 11.2005 — I actually never did get it to work.

Maybe the javascript was too mixed up with php.

There probably is a php line of code that would work.

Here is what I did:

1)Put an alert box to start surfing, so page could not be reloaded without a click.

2)Put an alert box (IE compatible only) that alerts the surfer to a framebreaker.

3)Increased the autosurfing timer by 2 seconds. You may add more.

4)Put an onunload tag (again IE compatible only) which brings the site focus back to the surfing page. Which means every pageload brings the site to be on top of other sites if surfing multiple pages. (Can only be minimized for 15 seconds)

If you use 4daily.com, you know what this is like.

As for bandwidth, autosurfing really does not use much.

Since any graphics are cached, and you are only calling a few lines of code each time.

I pay $19/month for 20GBs and it is plenty for now. I get anywhere between

30,000 and 100,000 site views a day.
Copy linkTweet thisAlerts:
@UltimaterMay 11.2005 — Couldn't a user with JavaScript disabled avoid all of your alerts and thus remain surfing as long as they want or even use a bookmark like the following:

[color=royalblue]javascript:void(window.alert=function(){return false})[/color]
Copy linkTweet thisAlerts:
@pummankMay 12.2005 — Hello Ultimater,

Here is my Surfbar.php Script, Now plz tell me where to add the exact code that my surfbar will stop automatically and members gets an alter box and they must leave the suef page after any member visit/surfed 100 sites

This time scripts works correct but you can make some alteration in it to stop surfbar after 100 sites

Start PHP

Please check attached file surfbar.zip. I tried to post script here but it was too long so I attached it, Please help me asap

End PHP

I'll learn some from you ?

Thanks

Pummank

[upl-file uuid=59c175e2-feaa-4322-bcc0-25175d7a711f size=4kB]surfbar.zip[/upl-file]
Copy linkTweet thisAlerts:
@UltimaterMay 16.2005 — *Moves Thread to top*
×

Success!

Help @stc60 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...