I have the following subscribe form:
<div class="AW-Form-2026756516"></div>
<script type="text/javascript">(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "http://forms.aweber.com/form/16/2026756516.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, "script", "aweber-wjs-kocxshsyj"));
</script>
I would like this to show or hide when the user clicks Subscribe button (Possibly dropdown effect or basic).
<div id="subscribe">Subscribe</div>
Many thanks for help.
You can do this:
$('#subscribe').click(function(){
$('.AW-Form-2026756516').slideToggle(); // or fadeToggle() or just toggle()
});
Related
Hi can anyone help me disable or block Aweber form popup in two of my Wordpress page. By default this code is site wide and put under my footer.php.
<div class="AW-Form-306596914"></div>
<script type="text/javascript">(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//forms.aweber.com/form/14/306596914.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, "script", "aweber-wjs-2vvzoocrg"));
</script>
Can I just put a CCS code on the page to disable the pop up or I need to edit the code itself?
Here's the two pages:
https://www.ataonline.edu.au/unlock-free-ebook-for-australia/
https://www.ataonline.edu.au/unlock-free-ebook-international/
I hope you can give me some idea on this. Thanks in advance!
Add this condition
<?php if(!is_page('2870') && !is_page('2853')) { ?>
<div class="AW-Form-306596914"></div>
<script type="text/javascript">(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//forms.aweber.com/form/14/306596914.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, "script", "aweber-wjs-2vvzoocrg"));
</script>
<?php } ?>
I am adding the facebook comments plugin to my website and have little coding knowledge.
I have added the following after the opening body tag:
<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = 'https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.11';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
And the following where I want the comments to display:
<div class="fb-comments" data-href="https://www.bbuboxing.co.uk/featherweight.html" width="100%" data-width="100%" data-numposts="5">
If I or a visitor is not logged in to Facebook, the plugin displays a button saying log in to post but I can't click it to log in, the button isn't clickable.
How do I make it so that I(or a visitor) can click this button to log in?
you're missing your app id which needs to be appended to the end of the src property in the sdk script tag like this:
<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = 'https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.11&appId=XXXX';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
replacing the XXXX with your registered facebook app id. if you haven't registered an app yet visit https://developers.facebook.com/ and go through the registration and signup process.
I've added Facebook like button plugin on my website everything works perfectly, except one thing: the plugin loads after the rest of the page is fully loaded and it doesn't look properly. There is a script template for that plugin:
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
I tried to add js.async = true; But it didn't work. Any other ideas?
I'm building a simple web-widget similar to Facebook Like button, and I want to set some parameters(ex. websiteId) to use them in my dynamically added script(http://analytics.dev/bundles/andreistatistics/js/like-button.js).
My question is: is there a way to pass my param websiteId to use it in like-button.js file? I would also like to avoid conflicts with other wbesiteId params defined in DOM.
<div class="like-button-container"></div>
<script>
(function(d, s, id) {
var websiteId = 7;
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id))
return;
js = d.createElement(s);
js.id = id;
js.src = "http://analytics.dev/bundles/andreistatistics/js/like-button.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'my-like-button'));
</script>
I am trying to use some Facebook code in one of my pages.
The code is:
<script type="text/javascript">(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=000000000";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
However when I try to validate this as an XHTML+RDFa page I get an error. The error is caused by the & sign in this part "xfbml=1&appId". The WC3 validator recommends using:
&
even in urls it says.
However, when I change the ampersand sign to:
&
The script no longer works.
Is there a way to get this to work correctly and still validate?
You should be able to get it to validate by wrapping the code in a CDATA tag, like so:
<script type="text/javascript">(function(d, s, id) {
//<![CDATA[
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=000000000";
fjs.parentNode.insertBefore(js, fjs);
//]]>
}(document, 'script', 'facebook-jssdk'));</script>
<script type="text/javascript">
/*<![CDATA[*//*---->*/
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=000000000";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
/*--*//*]]>*/
</script>
Much of JavaScript will not be interpreted correctly by the XHTML parser. You need to escape it with CDATA.