Force webpage to open outside facebook - facebook

I don't want my webpage to open inside facebook. It doesn't function quite right.
Is there a way to list a url that when reached, redirects to my external site that is NOT is the facebook interface?
I have tried uploading a php file with a redirect in it, but it makes no difference.
<script type="text/javascript">
window.top.location.href = "http://aurumhairstylists.co.nz";
</script>
<p>If you are not automatically redirected here is a link to <a target="_blank" href="http://shereewalker.com">shereewalker.com</a>. Opens in a new tab or window.</p>
Any help would be great
Thanks

IT is possible but the browser would block the page as a action not "requested by the user".
this is a VERY simple implementation:
<script>
function myFunction() {
var myWindow = window.open("http://aurumhairstylists.co.nz", "myWindow", "width=400, height=200");
}
</script>
<IMG SRC="1x1.gif" ALT="" HEIGHT=1 WIDTH=1 onLoad="myFunction()">
cheers

Related

redirect page in phonegap

PhoneGap is not able to open the internal link.In my html I am using href tag But unable to load the webpage..Can anyone please suggest how to redirect one html page to another html page in phonegap ?
You can try this.
Code ::
HTML
Next Page
Javascript
<script type="text/javascript">
function goToNext() {
window.location.href = './NextPage.html';
}
</script>
Hopefully, This will help you for navigating to a new page.
Thanks.
How About redirecting page automatically in iphone?
For example, i have used $.mobile.changePage("login.html"); based on jQuery Mobile, but the app just displays a blank page.
Whether to use $.mobile.changePage(); to redirect page in iphone?
It runs well in Android.

Facebook iFrame canvas app PHP sessions issue

I've been working on a problem for the last day and a half now and have still yet to find a solution.
When visitng my game on facebook (which is in facebook's iFrame) php sessions don't work. This is for IE and Safari. Chrome works fine.
I've already read all the posts on stack about this problem, which seems to be down to third party cookie security and needing interaction with the iFrame first. There was a workaround by making javascript post some form data to the iFrame first, but this seems to have been 'fixed' in the latest versions of the browsers very recently as this no longer works.
I even tried implementing a start page that would require them to click a link first (in the iFrame) to load another page which would then create the session. But even THAT doesn't work.
I'm also having trouble even loading new pages in the iFrame using javascript, which seems to always cause infinite loop refreshes.
And no, P3P headers do NOT solve it.
Does anyone have a solution to this problem? I can't be the only one with it, considering how many facebook apps exist!
I came across this problem using a client that had "Accept third party cookies" disabled. My solution was to force PHP to embed the session ID into the URI by putting this line at the start of each page:
ini_set('session.use_trans_sid', true);
As the URLs are in iframe within Facebook the SID is not seen in the top window.
For IE, you will need the P3P Headers set. Something like:
<?php header('P3P: CP="CAO PSA OUR"'); ?>
Safari blocks 3rd-party cookies by default. Currently, the only work-around that is working for me is to "pop-up" a new window to set the cookies. I have something like this:
<script type="text/javascript">
function safariFix(){
if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1){
window.open('https://yourdomainname.com/safari.php', 'Safari Fix','width=100,height=100');
}
}
</script>
And safari.php will have this:
<?php
setcookie("safari_test", "1");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Safari Fix</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
</head>
<script type="text/javascript">
$(document).ready(function(){
window.close();
});
</script>
<body>
Since Safari does not accept third-party cookies by default, we are forced to open this window.
This window will automatically close once we have set the cookies.
</body>
</html>
PROBLEM: This won't work if users have "block pop-ups" enabled in Safari. If anyone has a better solution for this, inform me ;)

Facebook Share Button breaks my SSL/HTTPS

Facebook Share Button breaks my SSL/HTTPS connection in Chrome. Chrome is displaying a red HTTPS with a (/) slash displaying acroess the https.
Its states:
Your connection to XXXXXXXXXX.com is encrypted with 256-bit encryption. However, this page includes other resources which are not secure. These resources can be viewed by others while in transit, and can be modified by an attacker to change the behavior of the page.
The connection uses TLS 1.0
The connection is encrypted using AES_256_CBC, with SHA1 for message authentication and DHE_RSA as the key exchange mechanism
The connection is not compressed.
How can I fix this issue? My code for Facebook is listed below:
name="fb_share"
share_url="https://mysexywear.com/product_details.php?prodId=<?php echo $prodId;?>&catId=<?php echo $catId;?>"
href="https://www.facebook.com/sharer.php">Share
src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"
Try using a relative protocol, like so:
name="fb_share" share_url="//mysexywear.com/product_details.php?prodId=&catId=" href="//www.facebook.com/sharer.php">
try this url ;)
https://facebook.com/connect.php/js/FB.Share
src="https://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"
Surely that would work?
use this codes:
<script>
function fbs_click()
{
u=location.href;
t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
return false;
}
</script>
<style>
html .fb_share_link {
height:18px;
display:block;
float:right;
margin-top:1px;
width:57px;
background:url(https://www.kiraguru.com/images/fbshare.png) no-repeat top left;
}
</style>
<a rel="nofollow" href="http://www.facebook.com/share.php?u=<;url>" onclick="return fbs_click()" target="_blank" class="fb_share_link"></a>
Change the " https://www.kiraguru.com/images/fbshare.png " field and change style code for your custom design.
!!! Important -> You have to use https:// for share button image.
Thanks.
Referencing this link to the Share Button JavaScript code will return a Security Certificate error warning in each of the major web browsers:
https://static.ak.fbcdn.net/connect.php/js/FB.Share
Until Facebook resolves the issue it is not possible to acheive a satisfactory user experience that uses the JavaScript-implemented Share button within a website served over https.
I'd suggest one of two workarounds:
1) Implement a "fake" Share button by creating a Share URL and applying it to an image:
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.your_url_encoded_webaddress.com" target="_blank">
<img src="../images/Share_Button.png" border="0" />
</a>
2) Use one of Facebook's non-deprecated Social Plugins ("Like" or "Send") to achieve similar functionality. Both of these are still fully supported and work over https:
http://developers.facebook.com/docs/plugins/

Close facebook share popup after share is complete?

I'm attempting to share a link on facebook via url. I get the share to work, however instead of loading the redirectURI, I want to close the popup window. My code:
function fb_share(url) { window.open(url,"share_window","width=400,height=300"); }
...
fb_share('http://www.facebook.com/dialog/feed?app_id=128000000000&link=http%3a%2f%2fwww.facebook.com%2fapps%2fapplication.php%3fid%128000000000%26sk%128000000000&picture=http://www.google.com/images/nav_logo83.png&name=name&description=description&redirect_uri=http%3a%2f%2fwww.facebook.com%2fapps%2fapplication.php%3fid%3d128398017257108%26sk%3dapp_128000000000&display=popup')
I wrote a page that can be used as the redirect_uri, which will close popup via javascript: http://www2.highpoint.edu/close_popup.php
View the source to see some simple HTML:
<!doctype html>
<html>
<h3>Thank you!</h3>
Close this window
<script type="text/javascript">
close();
</script>
</html>
It works when used as the callback from a Facebook Dialog.
Redirected url contains parameter post_id, so you can check on it and close window if you find it:
if (window.location.search.indexOf('post_id') == 1){
window.close();
}

AddThis : Cutomization

I have added Addthis widget to a website. Here is the autogenerated code which I have tweaked little bit:
<script type="text/javascript">
var addthis_config = {
"data_track_clickback": true,
services_compact: 'facebook, twitter,googlebuzz, digg, stumbleupon',
services_expanded: 'facebook, twitter,googlebuzz, digg, stumbleupon',
ui_cobrand: "ABC Company",
ui_header_color: "#ffffff",
ui_header_background: "#000000"
}
</script>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4dde778a54a20e05"></script>
<script type="text/javascript">
var addthis_share = {
templates: { twitter: 'check out {{title}} : {{url}} #ABC' },
url_transforms : { clean: true }
}
</script>
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_compact">
<img alt="Share" src="../images/icons/share.gif" /><img alt="ABC" src="../images/icons/financial_tip.png" />
</a>
</div>
I have added facebook, twitter, google buzz, StumbleUpon and Digg links inside the ADdthis compact and expandable widgets.
When I click the Share link, following window pop ups:
I dont want the Addthis footer to appear in the pop up window. I tried finding the div with jquery doc load and removing it..but it didnt help.
Other thing is when I click FB, it opens my account and the following message is displayed about posting on my wall:
Addthis is appending some garbage at the end of the shared url:
e.g after index.aspx starting from # to ;facebook ..it is appending some data that is irrelevant... how to fix it ..any idea...
If I share it on twitter, the login screen to twitter
I dont want the Addthis message in footer..how to hide/delete it
Similar to FB, when i login to my twitter account, some garbage is added to the end of the shared url:
Moreover, whenever i click any icon inside the compact Addthis list, Fb or twitter, a small window pop ups:
Can anyone help me with these.
THanks.
About twitter issue, you can use somthing like this..
<script type='text/javascript'>
var addthis_share =
{
templates: { twitter: '{{title}}: {{url}}' }
}
</script>
And change
<a class='addthis_button_tweet' tw:via='YOUR-USER-NAME'/>
I never tried other services. But have a look at Addthis API. I think you can find out something.
Malinda's answer is basically correct but doesn't explain what's going on - I think it's important to understand a bit more.
The question says, "Addthis is appending some garbage at the end of the shared url". This isn't garbage. The value after the #hashtag is a semi-random number generated by Addthis that can help you build really useful social media reports that can even show you which of your shares are re-shares - a critical component in modeling viral growth rates (which is what you want from social sharing). You can read more about that here: http://support.addthis.com/customer/portal/articles/381254-address-bar-sharing-analytics.
What Malinda's solution does is override the default Addthis Twitter template to omit this tracking data. That certainly works - you should just realize what you're giving up in terms of tracking your social media campaign.