I have links inside facebook canvas application. And when users click it, it should show in new tab or page. How to do that?
I use javascript location to redirect user to facebook login page.
I saw a code some months that is in javascript by a user in stackoverflow posted as a solution for this but I searched for two days and didn't find it.
Please help
I think the answer you're looking for is in the link below. In essence, a href="xyz" target="_top" and so: window.top.location=xyz
window.top.location
links-to-external-site-in-canvas-tab-on-facebook
If you want to open the link in new tab
window.open(urlOfNewPage);
If you want to open the link in same window
window.location = urlOfNewPage;
Related
Javascript - Need to open up open up two tabs when someone clicks on any links on my page.
I am a completely new when it comes to this stuff, but I understand most of it I just cant physically write it for some reason or another. Is there anyone out there that could help me? I have already looked at the open two link sections on here but none of them help. What I am trying to do is basically create a "secret page" when someone clicks ANY link on my site.. So there is a few buttons and pictures on my "thank you page" and I want that when someone clicks on ANY of the links or pictures, a NEW TAB is opened up in a NEW WINDOW and another page is opened up on the exact same thank you page.. is this possible at all? Any help would be greatly appreciated. Thank you all ahead of time!
Form what I understand you can attach an event handler function to the link
function openLinkTab(){
window.open('https://www.codexworld.com', '_blank');
window.location = "https://www.codexworld.com";
}
the first line will open a new tab and second line will redirect current page to other URL
I have articles posted on facebook from my website http://juniorgoldreport.com/
the website is made in wordpress, and I've also created a "Welome" landing page where I want most new users to be directed too.
I have no idea where I can find information on how to do this, even after countless efforts of googling.
To give an exact idea of what I' trying to create...
Where someone clicks on an article on facebook, it'll take them to the "welcome" sign up page, then have a link on it to the article that they clicked on. The link would change depending on what article they clicked on so they can be redirected properly.
I know I can just hard code it, and create multiple landing pages with different links in relation to the article posted, but this just seems inefficient.
Does anyone know how to go about doing this?
this is the landing page
http://juniorgoldreport.com/welcome/
You can try using Javascript, as it would be much easier than creating several webpages. At the point in your page where you want a link to be placed, put something like
<p id="mynewredirectlink">Hey!</p>
And then at the bottom of your code, add some javascript to resemble this:
<script type="text/javascript">
if (document.referrer === "facebooklink.com")//Where did you come from?
$("#mynewredirectlink").innerHTML = "Hey!" //Where are you going?
Then include the other sites you need, and close it with
</script>
There may be some sites that have varying parts, like an id, so if you need to, you can use (document.referrer.includes("facebook.com")) instead.
You can convert your landing page into a fullscreen modal popup. So every new visitor will see the popup when the visit the site or any article. They can fill the form / they can close it to see the article. There is already several plugin for modal popup / newsletter popup. You just need to do a little bit css to make it full screen.
I want to get a url of the page where user is going after reaching to my webpage. Let say user just came to my website page xyz and now he entered the another url abc on the browser bar. So now i want to get a link of abc using jquery or javascript. Is it possible?
Because it can't be done. The new location is private/sensitive information. Nobody wants you to know which sites they visit when they leave your site.
How can i get the destination url in javascript onbeforeunload event?
But if you want to do something before unload than you can get help from below link.
jquery beforeunload does not display message
You got help from this
$(window).on('unload', function(){
});
It used to be done this way:
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
<a type="button_count" share_url="http://google.pl" name="fb_share">Share this page on Your's wall</a>
And it used to generate a share button with text "Share this page on Your's wall" instead normal "Share". Since last update it doesnt work anymore.
Is there any posibillity to change the text on share button?
With Facebook JS SDK:
You now have to use the Feed Dialog, which is part of the Facebook JavaScript SDK.
Without Facebook JS SDK:
If you don't want to be bothered with their SDK, you can use this simple link instead:
Share this page on your wall
Here's what it'll look like if you're sharing Google.com with this link:
https://www.facebook.com/dialog/feed?app_id=140586622674265&link=http%3A%2F%2Fgoogle.com&name=Google&redirect_uri=http%3A%2F%2Fs7.addthis.com%2Fstatic%2Fpostshare%2Fc00.html
Also, please acknowledge these three things:
You need to replace [[URL]] and [[TITLE]] with a link to the page you want to share and its title (both url-encoded).
The Feed Dialog has to show from which Facebook app the post comes from. The app_id parameter in the URL above is the one from AddThis. Create a Facebook app and put its own id in the URL to use the name you want instead of "AddThis Sharing". You can keep the app_id from AddThis though, it works just fine.
The last parameter (redirect_uri) is the page where the user will be redirected after sharing. It's currently a page from AddThis with some JavaScript that will close the tab / window. That way, the dialog just disappears when it's not needed anymore. You don't have to change it either, works great.
My requirement is that I have a few hyperlinks on a webpage and when the user clicks on these hyperlinks I should redirect the user to an asp.net web page(Default.aspx) in a different website.
For the 1st time when the user clicks on one of the hyperlinks it will launch a new browser window with the Default.aspx loaded and then if the user clicks on some other hyperlink I want to redirect the user to the existing browser window(in which deafult.aspx is already loaded)with the content related to this particular hyperlink loaded,instead of launching a new browser window/tab.
But I am not sure of how to achieve this.I wonder if I can add some js to the asp.net Default.aspx page to achieve this.
Please could someone put me in the right direction?
Thanks
It sounds like the target property of the <a> tag will serve your purposes. Try:
Link 1
Link 2
Any clicks on the link subsequent to the first one should not result in additional windows.