Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Help with calling uri and refresh

    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:

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

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    what is this going to be used for? from what you describe it looks like you want to create some mischief :/
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow

  • #3
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Last edited by double007; 10-09-2008 at 05:45 PM.

  • #4
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I got the base code but I can't get the new_window.close function to work correctly:

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

  • #5
    Regular Coder
    Join Date
    May 2005
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Why use the browser?

    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:

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

  • #6
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,373
    Thanks
    11
    Thanked 592 Times in 572 Posts
    Quote Originally Posted by double007 View Post
    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.
    Code:
    <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>
    Last edited by rnd me; 10-10-2008 at 11:44 PM.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.6, IE11:9.1, IE9:3.1, IE10:3.0, FF:17.2, CH:46, SF:11.4, NON-MOUSE:38%


  •  

    Posting Permissions

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