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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    calling function

    At my job we have intranet web page, Once i'm in the webpage we look customer information by their phone number after we put their phone number and hit enter. I get button to press to review their account.

    The thing i'm trying to do is use Iframe as scr=mywebpage that i have for work then use the javascript that is on that iframe webpage from my work.


    Like

    here a example

    client.html

    <input type="button" value="Client" onclick="window.parent.innerframe.handleResponse()">

    <iframe id="innerframe" name="innerframe" src="server.html"></iframe>


    here is the server.html

    <script type="text/javascript">
    function handleResponse() {
    alert('testing')
    }
    </script>

    <input type="button" value="Server" onclick="handleResponse()">

    as you notice the click work even the javascript is loaded on serverside but i was able to call it as a resource in my iframe.

    here another one example

    <input type="button" value="Client" onclick="window.parent.innerframe.handleResponse()">

    <iframe id="innerframe" name="innerframe" src="http://developer.apple.com/internet/webcontent/client-simple.html"></iframe>

    Now this javascript won't be able make the call because of something not right i'm trying to call a function from website http://developer.apple.com/internet/...nt-simple.html that inside the html have this source

    <html><head><title>Remote Scripting with an IFrame - simple client page</title>

    <script type="text/javascript">
    function handleResponse() {
    alert('this function is called from server.html')
    }
    </script>

    </head>
    <body>

    <p>This is our client application. We want to be able to make calls to the server from this page without reloading.</p>

    <iframe id="RSIFrame"
    name="RSIFrame"
    style="width:0px; height:0px; border: 0px"
    src="blank.html"></iframe>

    <a href="server.html" target="RSIFrame">make RPC call</a>

    </body>
    </html>


    I would like to call this function handleResponse() from my client.html window that I have iframe to connect a webpage

    The thing is I want call javascript function from different site and just input a button to call it out from my client.html even though the javascript is not in my client is just in the website i'm linking to and trying call their function with a button on my client.html

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,045
    Thanks
    0
    Thanked 251 Times in 247 Posts
    For security reasons, javascript has no access to a page on a different domain.

  • #3
    New to the CF scene
    Join Date
    May 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Any other language beside javascript can do it? like java,php,c++, and etc?


  •  

    Posting Permissions

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