Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-13-2010, 03:06 PM   PM User | #1
JonathanFenny
New Coder

 
Join Date: Dec 2009
Location: Reading, UK
Posts: 13
Thanks: 5
Thanked 0 Times in 0 Posts
JonathanFenny is an unknown quantity at this point
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..
JonathanFenny is offline   Reply With Quote
Old 01-13-2010, 03:36 PM   PM User | #2
gusblake
Regular Coder

 
Join Date: Jan 2006
Posts: 568
Thanks: 6
Thanked 84 Times in 84 Posts
gusblake is on a distinguished road
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'.
gusblake is offline   Reply With Quote
Old 01-13-2010, 05:05 PM   PM User | #3
JonathanFenny
New Coder

 
Join Date: Dec 2009
Location: Reading, UK
Posts: 13
Thanks: 5
Thanked 0 Times in 0 Posts
JonathanFenny is an unknown quantity at this point
Ok that's fine too, could you tell me how to do this please?

Best Regards,
Jonathan.
JonathanFenny is offline   Reply With Quote
Reply

Bookmarks

Tags
automatically, facebook, javascript, php, share

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:16 PM.


Advertisement
Log in to turn off these ads.