/    Sign up×
Community /Pin to ProfileBookmark

I need the pros help on this(please)

i figured outwhat i am doing but it is a total disaster, feel free to toss inwhat help any one might have. thank you all

[code]<html>
<body>
<script type=”text/javascript”>

function GetInfo()

var t = 0
while (t<=10)
{
var xmlHttp;
try
{
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject(“Msxml2.XMLHTTP”);
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject(“Microsoft.XMLHTTP”);
}
catch (e)
{
alert(“Your browser does not support AJAX!”);
return false;
}
}
}
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
picked_file=window.open(“http://+xmlHttp”,”_blank”,”toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=400, height=200″)
t=t+1
setTimeout(3000)
picked_file=window.close();

}
}
xmlHttp.open(“GET”,”get_info.php”,true);
xmlHttp.send(null);
}
}
</script>
<form name=”myForm”>
Get it: <input type=”button” onClick=”GetInfo();” name=”start” value=”Start” />
Stop it: <input type=”button” onClick=”stop.GetInfo();” name=”stop” value=”Stop” />
</form>
</body>
</html>[/code]

Offcourse you can tell is is a disaster and it will not work,
the idea
While the variable t is =<10
get the variable form the php file get_info.php
open it in a new window
wait 3 seconds
close the window
and then ask for another value form the get_info.php file

in the form the stop button is to terminate the function incase the user did not wait for all 10 files.
that is not properly coded either.

I am horrible at this, i am doing my own project and i would really appreciatethe help of the professional community.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@USER4FUNauthorAug 03.2007 — IT IS SOLVED

I would like to change to

Open one window and force the url to change instead of open/close/open/close. I owuld appreaciate any ideas
<i>
</i>&lt;html&gt;
&lt;body&gt;
&lt;script type="text/javascript"&gt;
function GetInfo(t)
{ <br/>
if (t &lt;= 5) <br/>
{ var xmlHttp;
try
{
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
picked_file=window.open("http://" + xmlHttp.responseText,"picked_file","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=400, height=200");
t++;
setTimeout("picked_file.close(); GetInfo(" + t + ");",5000);
}
}
xmlHttp.open("GET","get_info.php",true);
xmlHttp.send(null);
}
}
&lt;/script&gt;
&lt;form name="myForm"&gt;
Get it: &lt;input type="button" onClick="GetInfo(1);" name="start" value="Start" /&gt;
Stop it: &lt;input type="button" onClick="GetInfo(5);" name="stop" value="Stop" /&gt;

&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
Copy linkTweet thisAlerts:
@USER4FUNauthorAug 03.2007 — I guess no one wants a peice of this one.
×

Success!

Help @USER4FUN 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.18,
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,
)...