Trying to get this code to work outside of CodePen


How would I get the code to work in JSFiddle?


<div class="container">	
<div id="instagram-feed-islemunda" class="instagram_feed"></div>

<script src=""></script>
<script src=""></script>
		$(window).on('load', function(){
				'username': 'islemunda_010',
				'container': "#instagram-feed-islemunda",
				'display_profile': false,
				'display_biography': false,
				'display_gallery': true,
				'get_raw_json': false,
				'callback': null,
				'styling': true,
				'items': 6,
				'items_per_row': 3,
				'margin': 1

Like this:

Basically, lose the superfluous IFFE and the on load callback:

- (function ($) {
-   $(window).on('load', function () {
        username: 'islemunda_010',
        container: '#instagram-feed-islemunda',
        display_profile: false,
        display_biography: false,
        display_gallery: true,
        get_raw_json: false,
        callback: null,
        styling: true,
        items: 6,
        items_per_row: 3,
        margin: 1,
-   });
- })(jQuery);

Put the JavaScript in the JavaScript pane. Then include jQuery by selecting it from the dropdown at the top of the JavaScript pane and add the second script via the Resources tab on the left.


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.