WebDeveloper.com

WebDeveloper.com (http://www.webdeveloper.com/forum/index.php)
-   JavaScript (http://www.webdeveloper.com/forum/forumdisplay.php?f=3)
-   -   Simple alert box question... (http://www.webdeveloper.com/forum/showthread.php?t=63348)

stc60 04-20-2005 01:29 PM

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!

Ultimater 04-20-2005 01:41 PM

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 onload 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:
HTML Code:

<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>


stc60 04-20-2005 02:05 PM

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");
}

Ultimater 04-20-2005 02:11 PM

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:
Code:

if (parent.score >= 100)
{
parent.window.alert("Click on to continue surfing");
}


pummank 05-11-2005 10:39 AM

Quote:

Originally Posted by stc60
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");
}

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

stc60 05-11-2005 02:20 PM

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.

Ultimater 05-11-2005 02:27 PM

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:
javascript:void(window.alert=function(){return false})

pummank 05-11-2005 11:32 PM

1 Attachment(s)
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

Ultimater 05-16-2005 04:30 PM

*Moves Thread to top*


All times are GMT -5. The time now is 11:44 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.