Put message on Facebook/Messenger programmatically - facebook

I want to put a link programmatically on Facebook/Messenger.
Here is my code:
<?php
echo "<div class='addthis_toolbox addthis_default_style addthis_32x32_style'
addthis:url='https://www.ietsdoen.nu/uitnodiging/' addthis:title='een titel' addthis:description='een beschrijving'>
<a class='addthis_button_messenger'></a></div>";
?>
When a user clicks the button a form appears with 2 inputs: To and Message. When he/she leaves the To-input empty, the link appears on Facebook in the message. But when he/she types something into the To-input, the link does't appear. Only the typed text appears. Is it possible to put both the text and the link in the message on Facebook?
Thanks in advance.

Related

Prefill a form checkbox from previous page url

I am using the following code to automatically have one checkbox in a list of many prefilled when a button is clicked in a product page for more information.
This code is taken from a previously solved question, but it does not work for me. What am I doing wrong?
PAGE A (button)
More Information
PAGE B
$(document).ready(function(){
var hash = location.hash; //
f(hash=="#myHash"){
("#checkbox1").prop("checked", !$("#checkbox1").prop("checked") );
}
});
<input type="checkbox" id="checkbox1" name="boxset" value="XXXX">
Also PAGE A is a Wordpress page which automatically reverses the href for some reason.
<a id="select-checkbox1" href="pageB.html#myHash">More Information</a>
I have tried this in two other websites with the same problem. It obviously does not like the format.
I would appreciate some help with this.

How to Remove the Facebook share Button from ADDTHIS API

<a class="addthis_button_facebook_like" fb:like:layout="button"></a>
I added Above line to show facebook like. it showing like button ,
but unfortunately its showing like button with the share button. how can i remove the share button from the line. i need only facebook like button. please help me
Try this one out
<a class="addthis_button_facebook_like" fb:like:layout="button_count" fb:like:action="recommend" fb:like:width="135"></a>
Thanks

Show/hide Iframe

I am using wordpress for my website and I am trying to set up my pages so that a user has to click a button to view the content. Yes, very simple with show/hide etc but the button I Want the user to click is this http://www.facebook.com/plugins/like.php
To display that in my page i need to use an iframe which is where it gets tricky. I have set up the show/hide code so that when a user clicks the like button (or anywhere in the iframe) it will display the content. But, no such luck!
This is my code
<div id="imagebox" style="display:none;"><?php $image = wp_get_attachment_image_src(get_field('image'), 'full'); ?>
<img src="<?php echo $image[0]; ?>" alt="<?php get_the_title(get_field('image')) ?>" /> </div>
<div onclick="ShowDiv()"><iframe src="http://www.facebook.com/plugins/like.php? href=http://www.facebook.com/BrandBang&" allowTransparency="true">
</iframe></div>
<script language="javascript">
function ShowDiv()
{
document.getElementById("imagebox").style.display = '';
}
</script>
I know that it is hard to use iframes to do what I am trying to do, but i am a total newbie when it comes to this stuff. Any help would be great!
Have tried giving your div an id="imagebox"?
EDIT:
This was already answered here.
But, I didn't realize at first sight that you're loading something in the iframe that is not coming from your own domain, so you're going to fall in a cross site scripting event, which is not allowed.
Afaik, you have to redesign some way your implementation.
For instance, you could retrieve the generated html from facebook using curl and then outputting in your own div. Something like that should work.

jqtouch go back after form submiting

I'm using jQtouch to build a page where the user can enter a kind of an ID and
get information (exam result) for this ID.
Because I take the results from the server, I used a form in the first page
with a text field and a submit button, and the action of this form send the user to the next page. Or at least, supposed to...
The problem is that also I'm being transferred to page with the results, and see the results properly, the Back button do nothing! BTW, in the address bar (above) I still see the name of the first page.
How can I go back to the "form" page? Thanks
<div class="current" id="byUserId">
<div class="toolbar">
<a class="back" id="goBack" > Back</a>
<h1> Exam Results</h1>
</div> ...
where the id="goBack" has a javascript:
$(function() {
$('#goBack').click(function() {
location.href = "enterId.jsp";
});
});
Using the regular back doesn;t work either:
<a class="back" href="#"> Back</a>
I now this is pretty late, but I had a similar frustrations and finally figured it out. The problem is that jQTouch intercepts all AJAX and form submit commands and safely send them itself. This isn't a problem except for when it's expecting some sort of callback, and there isn't one. In my case, I wanted to submit a form without a callback. To do this, look in the jqtouch.js library (around line 434) and comment out the following line:
if (href != '#') {
$.ajax({
url: href,
data: settings.data,
type: settings.method,
success: function (data) {
**// var firstPage = insertPages(data, settings.animation);**
This basically just tells jQTouch to submit the AJAX call but do nothing afterwards (don't change div's, don't show any callbacks and don't do any animations). Hope this helps.

How do I keep track of when what is the text entered in the form when the user navigates away from the page?

I have a piece of code like this.
<form method="get" action="{$self}" name="addcommentform">
<textarea title="{$enterComment}" name="comment" class="commentarea" </textarea>
<input class="Button" type="submit" value="{$postComment}" />
</form>
How do I keep track of when what is the text entered in the form's textarea when the user navigates away from the page? I want to prompt the user with a warning message so he/she doesn't lose the text.
Thanks.
You could use the javascript/jquery blur event, and if the user hasn't clicked the desired button have it display the form values. This might help JQuery Blur Validation Problem
Stu
Take a look at this Javascript code snippet:
http://www.boutell.com/newfaq/creating/disableclose.html
This takes advantage of the window's onbeforeunload event which fires when the user is about to leave the page.