Facebook share URL with get parameters - html

I'm trying to generate a share URL with get parameters and it's doing some double encoding shenanigans.
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.bing.com%2Fsearch%3Fq%3Dkeyword" />
produces an error url while
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.bing.com" />
is fine. Anyone have ideas?

Facebook share link needed to be cached on their side. This has since be resolved on facebooks end.

Related

Changing web page elements' appearance by appending extra parameters to URL

Recently I noticed that after searching for some term in Google and browsing the search result, the relevant web page showed my relevant search text as highlighted.
So, I noticed what Google has done is, as sending extra parameters by appending to the URL as #:~:text=this%20text%20will%20be%20highlighted.
As an example if I go to https://en.wikipedia.org/wiki/Stack_Overflow, it shows as follows;
But when I append #:~:text=Overflow to the URL and visit https://en.wikipedia.org/wiki/Stack_Overflow#:~:text=Overflow, then it shows as follows (note that word 'Overflow' is highlighted);
What I'm wondering is how this behavior is achieved?
What are such other types of such parameters that we could use?
Edit:
My browser is: Microsoft Edge, Version 83.0.478.45 (Official build) (64-bit)
Below are some more common and less advanced URL parameters but, I'll post them here anyways:
There are of course Anchor links that can be appended to the URL
<!-- https://Example.com/#top -->
<body>
<a name="top"> </a>
<a href="#top">
Go To Top Of Page
</a>
</body>
And URL query parameters that can be picked up by the server in a variety of ways, here is a python/Django example
# https://Example.com/?variable=someValue
import requests
def page_view(request):
variableValue = request.GET.get('variable', None)

onclick to forward request to other URL

I want to open a page on click of a link. Below is the link.
<a href='#' onClick=window.open('\\122.96.212.765\spread\form\5.0\tx1\NA\show\SPREAD_Show_ _33_PM\index_VIN_Test_ZASF91A.htm','_self') >CLICK HERE</a>.
But when i click the above link 404 error is displayed on the page as the URL is changing as below:
http://localhost:8080/122.96.212.765spreadform%05.SPREAD_Show_ _33_PMindex_VIN_Test_ZASF91A.htm
Please suggest, do i need to add ay extra code so that onclick even will work.
can try changing your \'s to /'s
As Geoff said, changing your backslash characters with forward slashes should solve your issue. I'm going to assume that because you tagged the question with spring and spring-mvc that you are trying to make this request to a Spring controller with a #RequestMapping matching the URL.
Your request is 404'ing because the actual request is being made to the incorrect URL because your backslash characters are causing issues with either parsing the URL, or generating the request URL. Because the request URL is malformed, it isn't getting picked up by your Spring Controller.
Fix your onclick URL and it should work.
The url used in your code,
"\\122.96.212.765\spread\form\5.0\tx1\NA\show\SPREAD_Show_ _33_PM\index_VIN_Test_ZASF91A.htm",
is syntactically incorrect.
The url does not have 'Scheme' part ("http:", "ftp:", etc.) and strange delimiter '\' are used instead of "/".
If valid url line "http://www.cnn.com/" is used, your code will work.
Try following:
<a href="#" onClick=window.open('http://www.cnn.com/','_self') >CLICK HERE</a>

Facebook developer server sided log in error

Even though the app id I gave it is correct, and the redirect uri is an absolute one, and it matches the one that is on the app's setting page, when I try to log in to my website through facebook I get the following error:
The redirect_uri URL must be absolute
This is my log in button:
<asp:ImageButton ID="LoginButton" ImageUrl="~/images/login.jpg" PostBackUrl="https://www.facebook.com/dialog/oauth?client_id={481180555313770}&redirect_uri={singular.somee.com}" runat="server" />
Help is appreciated
Remove the curly brackets {} from the client_id and the redirect_uri and add the protocol http or https to the url.
The final url looks like
https://www.facebook.com/dialog/oauth?client_id=481180555313770&redirect_uri=http://singular.somee.com
Now it works for me and Facebook does not show any error.

Set Facebook URL to Share with Parameters

Is it possible to crate SHARE link for specific page in my website? For instance:
http://www.MY-SITE.COM/index.php?page=show_book&book_id=$book_id
I tried:
<a title='Share on Facebook'
href='http://www.facebook.com/sharer.php?u=http://www.MY-SITE.COM/index.php?page=show_book&book_id=$book_id'
target='_blank'>
Share on Facebook
</a>
but it doesn't get the parameters.
If the parameters are getting stripped, try url encoding them (rawurlencode() in PHP).
Also make sure your target share page is serving up different open graph meta tags based on the parameters.
Share button is old. FB recommends to use the like-Button
http://developers.facebook.com/docs/reference/plugins/like/
looks like you need to echo your $book_id:
<a title='Share on Facebook'
href='http://www.facebook.com/sharer.php?u=http://www.MY-SITE.COM/index.php?page=show_book&book_id=<?php echo $book_id ?>'
target='_blank'>
Share on Facebook
</a>
A common approach to this, which will work amongst other providers too (twitter, g+ etc) is to use a url shortening service like http://bit.ly.
replace & with %26 something like
$url = 'http://www.MY-SITE.COM/index.php?page=show_book%26book_id='.$book_id;
<a title="Share on Facebook"
href="http://www.facebook.com/sharer.php?u=<?=$url?>">Share on Facebook</a>

How to use HTML to do a Skype call?

I tried to insert the following snippet in my script. By clicking the link it should do a call to a Skype account. I've been looking for hours now, but can't figure out why it doesn't work.
<pre><code><a href="callTo://USERNAME"><img src="http://goodies.skype.com/graphics/skypeme_btn_small_green.gif" border=0></a></code></pre>
Is it accepted in any way or do I miss something here?
Try "callto" (with no uppercase letters).
Link will initiate Skype to call my number!
<a href="skype:********?call">Link will initiate Skype
to call my Skype username!</a>
source: http://geek.michaelgrace.org/2010/03/create-html-link-that-starts-a-skype-call/
I have been fighting with the following link all day.
Start chat
The problem that I had was with the USERNAME part
Finally, I just solved it.
My name on Skype web page was name but the real name was name lastname. The link in my web page did make Skype to load in my Android phone but, Skype failed to find the account to wich I wanted to call (name lastname).
I tryed, and failed:
<a href="skype:name lastname?call">...
<a href="skype:name+lastname?call">...
<a href="skype:name%20lastname?call">...
<a href="skype:name-lastname?call">...
<a href="skype:name_lastname?call">...
<a href="skype:phonenumber?call">...
Then, the solution:
<a href="skype:live:emailnamewithoutdomain?call">...
I just hope u find it usefull.
And, do not forget that u have a plenty of commands to add after the ? in the url (add,call,chat,and so on).
Just for another option from their official website:
https://www.skype.com/en/developer/create-contactme-buttons
It's nice and easy to use, can be used both for chat or/and call.