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 Coder
    Join Date
    Dec 2009
    Location
    Reading, UK
    Posts
    13
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Exclamation Auto load Javascript file in a PHP page & if poss auto click botton on external page.

    Hello,

    I don't know if this can be done in Javascript, or requires any other language but i was wondering if this would be possible.

    I would like to embed this Javascript code in to a PHP file and then for it to run automatically upon the PHP file loading:

    Code:
    <td class="smallDesc"> <a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script> </td>
    The Javascirpt is the Facebook Share button that basically allows users that have Facebook to share the page there currently on in their Facebook status by pressing the button, but if there not logged in it shows the login page, not a problem just continue the script.

    The current button i which is what i want to load automatically in the PHP file is located here, to test the functionalilty just click "Share" button in blue..

    http://watch-movies-online.anyfilman...-Movie-17.html

    To summarise, i would like the above Javascript code to execute automatically upon pageload of this PHP file.. http://www.watch-movies-online.anyfi...p://google.com.

    If that could be done, and if this also is possible.. i would like for the "Share" button on the external page that is loaded from the Javascript code above to be clicked automatically so in effect when ever someone visits the PHP page after clicking "Click Here to Watch/Stream 2012 Online For Free" on this page it will automatically load the Facebook Share box, and automatically click the "Share" Button and then close the page if possible, but not required.

    Please feel free to ask any questions, i'll be happy to answer.

    Thanks in advance.

    Best Regards,
    Jonathan.
    Last edited by JonathanFenny; 01-13-2010 at 08:17 PM.

  • #2
    Regular Coder
    Join Date
    Jan 2006
    Posts
    568
    Thanks
    6
    Thanked 84 Times in 84 Posts
    You could open and then close the 'share' window from your page, but you can't access the document inside it because of a security feature called the 'same origin policy'.

  • #3
    New Coder
    Join Date
    Dec 2009
    Location
    Reading, UK
    Posts
    13
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Ok that's fine too, could you tell me how to do this please?

    Best Regards,
    Jonathan.


  •  

    Tags for this Thread

    Posting Permissions

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