Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Craig at Smash Balloon

    (@craig-at-smash-balloon)

    Hi nyoz,

    Have you tried checking the box on the “Configure” tab “Are you using an AJAX theme?”

    That might work. Otherwise we can try figuring out another way.

    Thanks,

    Craig

    Thread Starter nyoz

    (@nyoz)

    Yeah sorry, I forgot to mention I’ve tried this already. ^^

    Thread Starter nyoz

    (@nyoz)

    … and it didn’t work.

    Plugin Contributor Craig at Smash Balloon

    (@craig-at-smash-balloon)

    Hey again nyoz,

    You could try using this JavaScript with your onClick event idea in that case:

    if (!jQuery('#sb_extra_script').length) {
      jQuery('#sb_instagram').after("<script type='text/javascript'>" +
    
    "var sb_instagram_js_options = {'sb_instagram_at':'Insert Token Here'};"+
    
    "</script><script id='sb_extra_script' type='text/javascript' src='http://nyoz.fr/wp-content/plugins/instagram-feed/js/sb-instagram.min.js'></script><link rel='stylesheet' id='sb_instagram_styles-css'  href='http://nyoz.fr/wp-content/plugins/instagram-feed/css/sb-instagram.min.css?ver=1.5' type='text/css' media='all' /><link rel='stylesheet' id='sb-font-awesome-css'  href='https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' type='text/css' media='all' />");
    sbi_init();
    }

    Notice that there is a space for you to insert your own access token in the middle of the code above.

    Hopefully this helps!

    – Craig

    Thread Starter nyoz

    (@nyoz)

    Hi !

    Thanks for the script and the time you spend helping us. πŸ™‚

    Sadly, I get an “Uncaught SyntaxError: Invalid or unexpected token” error from the Google Chrome console. It seems to be on the line starting with “</script><script …” but I can’t find the error it’s talking about.

    And clicking on the portfolio item doesn’t do much.

    Well I’ll try to display my feed another way. Maybe lower on this page.
    I’ll leave the script as is right now, if you want to take a look at the error, and I’ll delete it later on.

    Cheers !

    • This reply was modified 8 years, 8 months ago by nyoz.
    Plugin Contributor Craig at Smash Balloon

    (@craig-at-smash-balloon)

    Hey again,

    Try this instead:

    jQuery(document).ready(function($) {
    if (!jQuery('#sb_extra_script').length) {
    jQuery('#sb_instagram').after("<script type='text/javascript'>var sb_instagram_js_options = {'sb_instagram_at':'Token'};</script><script id='sb_extra_script' type='text/javascript' src='http://nyoz.fr/wp-content/plugins/instagram-feed/js/sb-instagram.min.js'></script><link rel='stylesheet' id='sb_instagram_styles-css'  href='http://nyoz.fr/wp-content/plugins/instagram-feed/css/sb-instagram.min.css?ver=1.5' type='text/css' media='all' /><link rel='stylesheet' id='sb-font-awesome-css'  href='https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' type='text/css' media='all' />");
    sbi_init();
    }
    });

    See if it helps to remove the “+”

    Thanks!

    Thread Starter nyoz

    (@nyoz)

    Well, still not working.
    (Unexepect token on the first ” I guess, according to the console).

    But don’t worry, I found another way to use my instagram feed. It’s just down my page, that will be fine !

    Thanks a lot for the help anyway, really much appreciated ! πŸ™‚

    Plugin Contributor Craig at Smash Balloon

    (@craig-at-smash-balloon)

    Hey nyoz,

    Sorry we couldn’t figure the first issue out but I’m glad you figured out something that will work for you!

    Have a great rest of your week.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Ajax Post preview not triggering js’ is closed to new replies.