how to fix unexpected ‘ } ‘? [duplicate]

Question
add_action( 'wp_footer', 'my_footer_scripts' );
function my_footer_scripts(){
  ?>
<script>
    var memberCurrPage = 0;
    
    function LoadNextMemberList(type){
                
                memberCurrPage++;
                
                var requestString = "https://memorial.starwebco.com/api/getDeceasedByType?type=" + type + "&page=" + memberCurrPage + "&limit=100"; 
                
            
                jQuery.get( requestString, function(response) {
                    
                    var htmlContent = getMembersHtml(response);
                    //console.log("weve got a response from get_leaderboard", htmlContent);
                    jQuery( "#members-list-container" ).append( htmlContent );
                    
                });
    }
    function getMembersHtml(membersArray){
        var result = "";
        for(var i = 0; i < membersArray.length; i++){
            result += '<a href="/דורות?member_id=' + membersArray[i].id + '" class="mem-wall-item inline-block">';
            result += '<div id="user-item-" class="members-user-img-wrapper">';
            result += '<img class="mem-wall-user-img" src="' + getMemberImageLink(membersArray[i].photo, membersArray[i].sex) + '" />';
            result += '</div>';
            result += '<div class="member-item-name">';
            result += membersArray[i].firstName + ' ' + membersArray[i].lastName;
            result += '</div></a>';
            
        }
        return result;
    }
    function getMemberImageLink(imageLink, sex){
        var imagePath = "http://dorotmanager.starwebco.com/data/";
        var no_photo_male_source = "https://dorotmemorialine.com/images/man.jpg";
        var no_photo_female_source = "https://dorotmemorialine.com/images/female.jpg";
        if(imageLink == undefined){
            if(sex == 1){
                return no_photo_male_source;
            }else{
                return no_photo_female_source;
            }
        }else{
            return imagePath + imageLink;
        }
        
        
        
    }
     document.addEventListener('DOMContentLoaded', function() {
        
            jQuery(document).ready(function(){
                console.log("");
                //
                //community-place-holder community-1554
                var communityContent = '<div class="elementor-column-wrap">';
                communityContent += '<div class="elementor-widget-wrap">';
                communityContent += 'Hello world from dorot plugin!';
                communityContent += '</div></div>';
                //jQuery("#community-1554").html(communityContent); [vgrCommunityMembers id="1545"]
            });
        }, false);
        
(function(){
 })();
</script>
<?php } /// footer scripts ?>

when i load my website it says unexpected ‘}’ at line 196 and its the last line on here <?php } /// footer scripts ?>
im 2 days cant figure out my self what cause it to give error any ideas?

0
, , , davidasor 1 year 2020-07-13T10:10:40-05:00 0 Answers 76 views 0

Leave an answer

Browse
Browse