I'm trying to get the user to login using their Facebook account on the page but for some reason the button on the page does nothing. What the heck am I doing wrong? Link: http://friendsconnect.org/Main.php.
Pasting the FB.init call into my JavaScript console and then hitting the "connect" button got me the usual Facebook Connect window so you're probably having timing issues. Try changing your FB.init call to this:
<script type="text/javascript">
$(document).ready(function() {
FB.init({appId: '168032083219061', status: true, cookie: true, xfbml: true});
});
</script>
That way it won't be called until everything is all set up. Also, you don't need all three of these:
<script src="http://friendsconnect.org/jquery_custom/jquery.curvycorners.source.js" type="text/javascript"></script>
<script src="http://friendsconnect.org/jquery_custom/jquery.curvycorners.packed.js" type="text/javascript"></script>
<script src="http://friendsconnect.org/jquery_custom/jquery.curvycorners.min.js" type="text/javascript"></script>
You only need one of them, probably the jquery.curvycorners.min.js version.
Related
Hello my problem with this library that does not load me on the first page, instead if I "refresh" if it loads, and the internet explorer does not work for me. someone has happened something similar. I don't know what I'm doing wrong, I put a link and a capture of the error. THANK YOU https://ccc.es/empresa/ https://ibb.co/3fXLPyH
<script type='text/javascript' src='https://ccc.es/wp-content/themes/norebro/assets/js/libs/owl.carousel.min.js?ver=5.4.2'></script>
I have found a possible solution from another colleague who passed by here I copy it, I don't know if this solution can be improved, but it works for me for now
`<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>
<!--DO NOT ENTER ANY EXTERNAL LINK IN BETWEEN-->
<script type="text/javascript">
$(document).ready(function() {
$('.owl-carousel').owlCarousel({
loop: true,
});
});
</script>`
I have a javascript running on a squarespace site, but it only seems to work after the page has been refreshed once.
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$('.markdown-block .sqs-block-content h2').addClass('ui-closed').css('cursor','pointer');
$(".markdown-block .sqs-block-content h2").nextUntil("h2").slideToggle();
$(".markdown-block .sqs-block-content h2").click(function() {
$(this).nextUntil("h2").slideToggle();
$(this).toggleClass('ui-closed ui-open');
});
});
</script>
In Squarespace, when your custom Javascript only works after a page refresh, it most likely has to do with Squarespace's AJAX loading:
Occasionally, Ajax may conflict with embedded custom code or anchor
links. Ajax can also interfere with site analytics, logging hits on
the first page only.
You may be able to disable AJAX for your template. Or, see the other approaches outlined here: https://stackoverflow.com/questions/54493314#54493314
im using a sign up form of mailchimp, its a pop up but it have a cookie to dont show it again even if the user reloads the page.
this is the script:
<script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script><script type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us15.list-manage.com","uuid":"3dd49f3f5fd6be7bc1be03226","lid":"049a3764fd"}) })</script>
But i want allways display, is there a form to do this?
the idea is to set their cookie as expired to have to possibility to display it next time.
Please check this page :
https://gist.github.com/scottmagdalein/259d878ad46ed6f2cdce
I have the following js from facebook which simply loads either a feed or send dialog depending on method setting.
It loads it on page load. Can it be instead loaded on click? Meaning when a user wants it rather than when the page loads?
Example js
<script src="http://connect.facebook.net/en_US/all.js"></script>
<div id="fb-root"></div>
<script>
// assume we are already logged in
FB.init({appId: '123456', xfbml: true, cookie: true});
FB.ui({
method: 'feed',
name: 'People Argue Just to Win',
link: 'http://www.nytimes.com/2011/06/15/arts/people-argue-just-to-win-scholars-assert.html',
});
</script>
Sure, why not! Serve the API inside a function and execute the function on click of an anchor tag.
Here's the demo: http://jsfiddle.net/kayen/N9jhL/
I got a Facebook canvas apps that already works for authentification on server side and client side. I can post on the wall of my user, and run my app in the canvas fine.
I wanted to add a 'invite your friends' page, and followed the doc by creating a xFBML form:
[...]
<div id='invite-friends-form'>
<fb:serverfbml style="width: 650px;">
<script type="text/fbml">
<fb:fbml>
<fb:request-form
action="http://www.myapp.com:8080//invite/"
method="POST"
invite="true"
type="Name of my app"
content="My app description
<fb:req-choice url='http://apps.facebook.com/myapp/'
label='Accept'
/>
" >
<fb:multi-friend-selector
showborder="false"
actiontext="Invite your friends to my app"
rows="4"
> <fb:multi-friend-selector />
</fb:request-form>
</fb:fbml>
</script>
</fb:serverfbml>
</div>
<div id='fb-root'></div>
</body>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="http://connect.facebook.net/fr_FR/all.js"></script>
<!-- This does nothing so I commented it out. Can't find a way to debug
<script src="http://static.ak.fbcdn.net/connect/en_US/core.debug.js"></script> -->
<script src="http://myapp.com:8080/js/my_app_js.js"></script>
</html>
This xFBML renders fine when tested in their test page.
Now, in my iframe, I got nothing but the facebook loading animation displaying forever.
Here is my Javascript. I use jQuery to run the code once DOM is ready:
$(function(){
FB.init({
appId : 'my_app_id',
status : true,
cookie : true,
xfbml : true,
level : "debug"
});
FB.getLoginStatus(function(response) {
if (response.session) {
// logged in and connected user, someone you know
alert('logged in'); // this always show up
FB.XFBML.parse(document.getElementById('invite-friends-form'),
function(e) {alert(e)}
);
alert('after xfmbl parsing'); // this sometime show up
}
});
[...]
I got no error showing up, and can't find anyway to debug this. I feel stuck.
Help warmly welcome :-)
Found it:
You need to fill "url" and "domain name" in the internet site section of your app settings with url being the full web url (not the canvas one) and domain should be something like "mysite.com".