Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

nuxt facebook graph api

const vue_fb = {}
vue_fb.install = function install(Vue, options) {
    (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"
        fjs.parentNode.insertBefore(js, fjs)
        console.log('setting fb sdk')
    }(document, 'script', 'facebook-jssdk'))

    window.fbAsyncInit = function onSDKInit() {
        FB.init(options)
        FB.AppEvents.logPageView()
        Vue.FB = FB
        window.dispatchEvent(new Event('fb-sdk-ready'))
        vue_fb.sdk = FB // do not forget this line
    }
    Vue.FB = undefined
}

import Vue from 'vue'

Vue.use(vue_fb, {
    appId: 'your-app-id',
    autoLogAppEvents: true,
    xfbml: true,
    version: 'v2.9'
})
// and this line
export default ({ app }, inject) => {
inject('fb', vue_fb)
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: coindeskapi ethereum 
Javascript :: how to use browser sync in vuetify 
Javascript :: tskill nodejs port 
Javascript :: for (var i = 0; i < 10; i++) { setTimeout(function () { console.log(i) }, 10) } What 
Javascript :: stop monitorevents 
Javascript :: random order of buttons on refresh in vanilla js 
Javascript :: javascript expressions JSX 
Javascript :: jsrender get index 
Javascript :: get number of elements in hashmap javascript 
Javascript :: js browse file 
Javascript :: proet javascript web 
Javascript :: Return a sorted array without mutating the original array JS Javascript Free Code Camp FCC 
Javascript :: how to send authorization in header of HTTP GET using ajax 
Javascript :: notification bell icon bootstrap react 
Javascript :: bad site theme 
Javascript :: $("#symptomSelector").symptomSelector WHAT DOES THIS MEAN IN JAVASCRIPT 
Javascript :: js increment safety value html 
Javascript :: jsonb_set remove key 
Javascript :: cara-membuat-post-vi…ounter-di.html:1440 get https://bloggertut.googlecode.com/svn/trunk/js/highlight.pack.js net::err_aborted 404 
Javascript :: upload blob to server 
Javascript :: angular scroll event on div chang width 
Javascript :: angry professor javascript 
Javascript :: laravel datables get next input jquery next 
Javascript :: react native map repeate 
Javascript :: flowjs attributes 
Javascript :: benchmark ram usage angular 
Javascript :: adding a variable to a string without using + in javascript 
Javascript :: react native whatsapp integration 
Javascript :: window.initMochaPhantomJS(); 
Javascript :: cordova read file in www folder 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =