...

View Full Version : Help with calling uri and refresh



double007
10-07-2008, 07:17 PM
Now I have asked this question to many, many people and no one can seem to give me an answer. Please, dear God, can someone know exactly how to do what I need this to do:

1) Call a URI as soon as the page loads
2) Refresh the page to another page for which a URI is called again
3) Be able to do that as many times as I need to

Here is my current code and it doesn't work:




<html>
<head<meta http-equiv='refresh' content='5; url=callto01.html'></head>

<body><script type="text/javascript">

function init() {
var linkPage = document.getElementById('call').href;
window.location.href = linkPage;
}

onload = init;

</script>

</body>
<a href="callto:1234567890" id="call">call</a>

</html>



I want to create a page that as soon as it is opened, a url (uri url) is called (callto:12021234567). Then, right after that is called, it refresh (refresh redirects) to another page such as call01.html.

aka

I want to open the uri, I want it to open as soon as the page does, as if the user clicked it as soon as the page loads. Then redirect to another page.

I would appreciate so much if someone could help me, TIA!

shyam
10-08-2008, 04:02 PM
what is this going to be used for? from what you describe it looks like you want to create some mischief :/

double007
10-09-2008, 05:34 AM
I assure you there is no plans of mischief. I am a C programmer needing to create a page to work with my company's new API. If you have an answer for me, I would be more than grateful to hear it.

I'll try to break this down further.

*User opens this web page*
*skype:1234567890* tells skype to call 1234567890 (meaning it _calls_ this uri, like it loads the url as if it told the webpage to open google.com, same principle)
After it does that, the page (the main page, the one with all this code in it, the one telling it what to do, the one what we are talking about that needs the correct code) redirects to blah.html (or google.com or blah.com, etc).

You could even think about it like this:
I want a page that as soon as it opens, it opens (popup) a new windows to go to google.com. Then after it opens the new window (the popup), the main page redirects to blah.com

Same thing I'm trying to achieve here, maybe those terms will help.

Thanks again.

double007
10-10-2008, 02:42 AM
I got the base code but I can't get the new_window.close function to work correctly:




<html>
<head>
<script language = "JavaScript">
function call(main, name)
{
new_window = window.open('skype:1234567890', 'skype', ' menubar, resizable, dependant, status, width=100, height=100')
}
</script>
</head>
<body onload = "call();">
<body onload = "setTimeout("new_window.close()", 10000);">
<meta http-equiv='refresh' content='15; url=nextpg.html'>
</body>
</html>



What is wrong with this code? TIA.

VortexCortex
10-10-2008, 08:19 PM
Ok... I think I understand what you're trying to do...
You want to execute skype to call a number.
wait for a few seconds.
then execute skype again to call another number.

Why do this with your web browser? You said you are a C programmer.

In C you would do this:



// init code goes here
// inside "main"
system("c:\program files\skype\phone\skype.exe /callto:0123456789");
sleep(10);
system("c:\program files\skype\phone\skype.exe /callto:1234567890");
sleep(10);
system("c:\program files\skype\phone\skype.exe /callto:2345678910");
// rest of your code.


The system function executes a shell command.
insert the correct path to your skype.exe in the above code, and change the phone numbers accordingly.

If you put the above into a while loop instead, you could have the C program read in the phone numbers from a file one line at a time and call as many times as needed.

rnd me
10-10-2008, 11:38 PM
What is wrong with this code? TIA.

you cannot control windows in other domains, whether you opened them or not.

google "same origin" for 411.

if you merely want to launch the external application associated with the skype url, changing the .src of a hidden iframe would be more elegant, and prevent pop-up blockers from breaking your page.


this might work, can't test as i don't skype.


<html>
<head>
<meta http-equiv='refresh' content='15; url=nextpg.html'>
<title>launching skype...</title>
<script language = "JavaScript">

function call(main, name){
document.getElementById("iframe1").src = 'skype:1234567890';
}
</script>
</head>
<body onload = "call();">
<iframe name='iframe1' id='iframe1' style="display:none;"></iframe>
</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum