I’m using a plugin that I found from searching the web called Apprise. It has worked well for what I have needed thus far. But, I want to apprise the facebook login plugin and to to that I need to following code:
<fb:login-button scope='email,publish_stream'>
Login
</fb:login-button>
<script type='text/javascript' src='http://connect.facebook.net/en_US/all.js'></script>
<script>
window.fbAsyncInit = function() {
FB.init({
appId: '123456789',
cookie: true,
xfbml: true,
oauth: true
});
FB.Event.subscribe('auth.login', function(response) {
window.location = '/fb_redirect.php';
});
FB.Event.subscribe('auth.logout', function(response) {
window.location.reload();
});
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
Anything that you want to be apprised can be done by putting
apprise();
in the javascript. However, putting the <script></script> tags inside of the JS code (apprise();) causes all sorts of confusion because it’s not clear where the JS code ends.
Any ideas?
The method that works in both
<script>blocks and inline Javascript is\uxxxx, wherexxxxis the hexadecimal character code.<–\u003c>–\u003e"–\u0022'–\u0027\–\u005c&–\u0026Demo:
HTML: