Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3433700
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:36:29+00:00 2026-05-18T07:36:29+00:00

Eclipse is givign me a syntax error along these lines but I don’t see

  • 0

Eclipse is givign me a syntax error along these lines but I don’t see anything wrong there:

$('.addNewFolder').click(function() {
    showModal('modal_div', 'Nový adresár');
    var id = '<?php echo ToHtml($idFolder); ?>';
    $('.folders .trow1').each(function() {
        if ($(this).css('backgroundColor') == 'rgb(52, 108, 182)' || $(this).css('backgroundColor') == '#346cb6') {
            id = $(this).attr('rel');
        }
    });
    ajaxElementCall('modal_div', 'body/obsah/obrazy/folderAdd.php?idFolder='+id);
});

After PHP parsing:

$('.addNewFolder').click(function() {
    showModal('modal_div', 'Nový adresár');
    var id = '';
    $('.folders .trow1').each(function() {
        if ($(this).css('backgroundColor') == 'rgb(52, 108, 182)' || $(this).css('backgroundColor') == '#346cb6') {
            id = $(this).attr('rel');
        }
    });
    ajaxElementCall('modal_div', 'body/obsah/obrazy/folderAdd.php?idFolder='+id);
});

This is what IDE says:

Syntax error on token "}", invalid MethodHeaderName

I’ve been staring at that code for at least half an hour. I am either blind or going crazy.

EDIT:

The whole javascript on the page:

<script type="text/javascript">
    //<!--
$(document).ready(function() {

    function in_array (needle, haystack, argStrict) {
        var key = '', strict = !!argStrict; 
        if (strict) {
            for (key in haystack) {
                if (haystack[key] === needle) {
                    return true;            }
            }
        } else {
            for (key in haystack) {
                if (haystack[key] == needle) {
                    return true;
                }
            }
        }
         return false;
    }

    var openedFolders = new Array();
    <?php if (count($_SESSION['ECM']['openedSlideFolders']) > 0) : ?>
    <?php $i = 0; foreach ($_SESSION['ECM']['openedSlideFolders'] as $aVal): ?>
        <?php echo "openedFolders[$i] = '$aVal';\n"; ?>
    <?php ++$i; endforeach; ?>
    <?php endif; ?>

    var start = 0;
    var stop = 0;
    $('.drag').each(function() {
        var draggables = $(this).parents('table').find('.drag');
        var $next = draggables.filter(':gt(' + draggables.index(this) + ')').first();
        var width = $(this).css('width');
        var nextWidth = $next.css('width');
        if (nextWidth > width && 30 == parseInt(width)) {
            $(this).removeClass('ordinaryFolderClosed');
            $(this).removeClass('ordinaryFolderOpened');
            if (in_array($(this).attr('rel'), openedFolders)) {
                $(this).addClass('ordinaryFolderOpened');
            } else {
                $(this).addClass('ordinaryFolderClosed');
            }               
        }
        if (in_array($(this).attr('rel'), openedFolders)) {
            start = 1;
        }
        if (1 == start && stop < 2) {               
            if (30 == parseInt(width)) {
                stop++;
            }
        } else {
            start = 0;
            stop = 0;
            if (parseInt(width) > 30) {
                $(this).parent().parent().hide();
            }
        }
    });

    function dragDrop()
    {
        $('.folders .trow1').hover(
            function () {
                if ($(this).css('backgroundColor') != 'rgb(52, 108, 182)' && $(this).css('backgroundColor') != '#346cb6') {
                    $(this).css('background', "#C2E3EF");
                }
            },
            function () {
                if ($(this).css('backgroundColor') != 'rgb(52, 108, 182)' && $(this).css('backgroundColor') != '#346cb6') {
                    $(this).css('background', 'transparent');   
                }
            }
        );

        $('.drag').click(function() {
            var draggables = $(this).parents('table').find('.drag');
            var $next = draggables.filter(':gt(' + draggables.index(this) + ')').first();
            var width = $(this).css('width');
            var nextWidth = $next.css('width');
            if (nextWidth > width && 30 == parseInt(width)) {
                var isVisible = $next.is(':visible');
                if (isVisible) {
                    $(this).removeClass('ordinaryFolderClosed');
                    $(this).removeClass('ordinaryFolderOpened');
                    $(this).addClass('ordinaryFolderClosed');
                } else {
                    $(this).removeClass('ordinaryFolderClosed');
                    $(this).removeClass('ordinaryFolderOpened');
                    $(this).addClass('ordinaryFolderOpened');
                }
                clickedId = $(this).attr('rel');
                $.ajax({
                    type:    'POST',
                    url:     'body/obsah/obrazy/setOpenedFolder.php',
                    data:    'id='+clickedId,
                    success: function(msg){
                        //alert(msg);
                    }
                });
                var start = 0;
                var stop = 0;
                var i = 0;
                $('.drag').each(function() {
                    if (0 == start) {
                        iteratedId = $(this).attr('rel');
                        if (iteratedId == clickedId) {
                            start = 1;
                        }
                    }
                    if (1 == start && stop < 2) {
                        if ($(this).css('width') > width) {
                            if (isVisible) {
                                $(this).parent().parent().hide();
                            } else {
                                $(this).parent().parent().show();
                            }                           
                        } else {
                            stop++;
                        }
                    }
                    i++;
                });
            }
        }); 

        var dragId = 0;
        var dropId = 0;
        var isFile = false;

        $('.drag').mousedown(function() {
            if ($(this).attr('rel') !== undefined) {
                dragId = $(this).attr('rel');
                dragId = dragId.split(',');
                dragId = dragId[0];
            }
            isFile = false;
        });

        $('.drag2').mousedown(function() {
            if ($(this).attr('rel') !== undefined) {
                dragId = $(this).attr('rel');
                dragId = dragId.split(',');
                dragId = dragId[0];
            }
            isFile = true;
        }); 

        $('.drag').draggable({ 
            revert: true,
            cursorAt: {top: 0, left: 0}
        });

        $('.drag2').draggable({
            revert: true,
            cursorAt: {top: 0, left: 0}
        });


        $('.drop').droppable({
            tolerance: 'pointer',
            drop: function() {
                if ($(this).attr('rel') !== undefined) {
                    dropId = $(this).attr('rel');
                    dropId = dropId.split(',');
                    dropId = dropId[0];
                    if (dropId != dragId) {
                        if (false == isFile) {
                            $.ajax({
                                type:    'POST',
                                url:     'body/obsah/obrazy/folderMove.php',
                                data:    'nid='+dragId+'&pid='+dropId,
                                success: function(msg){
                                    <?php echo $aJsOnDrop; ?>;
                                    dragDrop();
                                }
                            });
                        } else if (true == isFile) {
                            $.ajax({
                                type:    'POST',
                                url:     'body/obsah/obrazy/slideMove.php',
                                data:    'fid='+dragId+'&did='+dropId,
                                success: function(msg){
                                    <?php echo $aJsOnDrop; ?>;
                                    dragDrop();
                                }
                            });
                        }
                    }
                }           
            }
        });

    }

    dragDrop();

    $('.folderListOnclick').click(function() {
        var append = 'idFolder='+$(this).attr('rel')+'&browse=<?php echo $browse; ?>';
        ajaxElementCall('obrazy_list', '<?php echo $dirPrefixBody; ?>/listBase.php?'+append);
        dragDrop();
        $('.trow1').css('background', 'transparent');
        $('.trow1').css('color', '#3e4245');
        $(this).parent().css('background', "#346cb6 url('img/menuButtonOver.png') left top repeat-x");
        $(this).parent().css('color', 'white');
    });

    $('.rootFolderListOnclick').click(function() {
        window.location = 'navigator.php?kam=obrazy';
        dragDrop();
    });

    $('.folderEditOnclick').click(function() {
        var append = 'idFolder='+$(this).attr('rel');
        showModal('modal_div', 'Editácia adresára'); 
        ajaxElementCall('modal_div', '<?php echo $dirPrefixBody; ?>/folderEdit.php?kam=edit1&'+append);
    });

    $('.folderDeleteOnclick').click(function() {
        var append = 'idFolder='+$(this).attr('rel');
        showModal('modal_div', 'Vymazanie adresára'); 
        // TODO 0 Nemam sajnu, aka chyba je tuna - Eclipse mi tu hadze syntax error
        ajaxElementCall('modal_div', '<?php echo $dirPrefixBody; ?>/folderDelete.php?kam=del1&'+append);
    });

    $('.addNewFolder').click(function() {
        showModal('modal_div', 'Nový adresár');
        var id = '<?php echo ToHtml($idFolder); ?>';
        $('.folders .trow1').each(function() {
            if ($(this).css('backgroundColor') == 'rgb(52, 108, 182)' || $(this).css('backgroundColor') == '#346cb6') {
                id = $(this).attr('rel');
            }
        });
        ajaxElementCall('modal_div', 'body/obsah/obrazy/folderAdd.php?idFolder='+id);
    });

});    //-->
</script>

After PHP parsing:

<script type="text/javascript">
    //<!--
$(document).ready(function() {

    function in_array (needle, haystack, argStrict) {
        var key = '', strict = !!argStrict; 
        if (strict) {
            for (key in haystack) {
                if (haystack[key] === needle) {
                    return true;            }
            }
        } else {
            for (key in haystack) {
                if (haystack[key] == needle) {
                    return true;
                }
            }
        }
         return false;
    }

    var openedFolders = new Array();
                openedFolders[0] = '3';

    var start = 0;
    var stop = 0;
    $('.drag').each(function() {
        var draggables = $(this).parents('table').find('.drag');
        var $next = draggables.filter(':gt(' + draggables.index(this) + ')').first();
        var width = $(this).css('width');
        var nextWidth = $next.css('width');
        if (nextWidth > width && 30 == parseInt(width)) {
            $(this).removeClass('ordinaryFolderClosed');
            $(this).removeClass('ordinaryFolderOpened');
            if (in_array($(this).attr('rel'), openedFolders)) {
                $(this).addClass('ordinaryFolderOpened');
            } else {
                $(this).addClass('ordinaryFolderClosed');
            }               
        }
        if (in_array($(this).attr('rel'), openedFolders)) {
            start = 1;
        }
        if (1 == start && stop < 2) {               
            if (30 == parseInt(width)) {
                stop++;
            }
        } else {
            start = 0;
            stop = 0;
            if (parseInt(width) > 30) {
                $(this).parent().parent().hide();
            }
        }
    });

    function dragDrop()
    {
        $('.folders .trow1').hover(
            function () {
                if ($(this).css('backgroundColor') != 'rgb(52, 108, 182)' && $(this).css('backgroundColor') != '#346cb6') {
                    $(this).css('background', "#C2E3EF");
                }
            },
            function () {
                if ($(this).css('backgroundColor') != 'rgb(52, 108, 182)' && $(this).css('backgroundColor') != '#346cb6') {
                    $(this).css('background', 'transparent');   
                }
            }
        );

        $('.drag').click(function() {
            var draggables = $(this).parents('table').find('.drag');
            var $next = draggables.filter(':gt(' + draggables.index(this) + ')').first();
            var width = $(this).css('width');
            var nextWidth = $next.css('width');
            if (nextWidth > width && 30 == parseInt(width)) {
                var isVisible = $next.is(':visible');
                if (isVisible) {
                    $(this).removeClass('ordinaryFolderClosed');
                    $(this).removeClass('ordinaryFolderOpened');
                    $(this).addClass('ordinaryFolderClosed');
                } else {
                    $(this).removeClass('ordinaryFolderClosed');
                    $(this).removeClass('ordinaryFolderOpened');
                    $(this).addClass('ordinaryFolderOpened');
                }
                clickedId = $(this).attr('rel');
                $.ajax({
                    type:    'POST',
                    url:     'body/obsah/obrazy/setOpenedFolder.php',
                    data:    'id='+clickedId,
                    success: function(msg){
                        //alert(msg);
                    }
                });
                var start = 0;
                var stop = 0;
                var i = 0;
                $('.drag').each(function() {
                    if (0 == start) {
                        iteratedId = $(this).attr('rel');
                        if (iteratedId == clickedId) {
                            start = 1;
                        }
                    }
                    if (1 == start && stop < 2) {
                        if ($(this).css('width') > width) {
                            if (isVisible) {
                                $(this).parent().parent().hide();
                            } else {
                                $(this).parent().parent().show();
                            }                           
                        } else {
                            stop++;
                        }
                    }
                    i++;
                });
            }
        }); 

        var dragId = 0;
        var dropId = 0;
        var isFile = false;

        $('.drag').mousedown(function() {
            if ($(this).attr('rel') !== undefined) {
                dragId = $(this).attr('rel');
                dragId = dragId.split(',');
                dragId = dragId[0];
            }
            isFile = false;
        });

        $('.drag2').mousedown(function() {
            if ($(this).attr('rel') !== undefined) {
                dragId = $(this).attr('rel');
                dragId = dragId.split(',');
                dragId = dragId[0];
            }
            isFile = true;
        }); 

        $('.drag').draggable({ 
            revert: true,
            cursorAt: {top: 0, left: 0}
        });

        $('.drag2').draggable({
            revert: true,
            cursorAt: {top: 0, left: 0}
        });


        $('.drop').droppable({
            tolerance: 'pointer',
            drop: function() {
                if ($(this).attr('rel') !== undefined) {
                    dropId = $(this).attr('rel');
                    dropId = dropId.split(',');
                    dropId = dropId[0];
                    if (dropId != dragId) {
                        if (false == isFile) {
                            $.ajax({
                                type:    'POST',
                                url:     'body/obsah/obrazy/folderMove.php',
                                data:    'nid='+dragId+'&pid='+dropId,
                                success: function(msg){
                                    ajaxElementCall('__folderList', 'body/obsah/obrazy/folders.php?browse=0&idFolder=', 'obrazy_list', 'body/obsah/obrazy/listBase.php?browse=0&idFolder=');
                                    dragDrop();
                                }
                            });
                        } else if (true == isFile) {
                            $.ajax({
                                type:    'POST',
                                url:     'body/obsah/obrazy/slideMove.php',
                                data:    'fid='+dragId+'&did='+dropId,
                                success: function(msg){
                                    ajaxElementCall('__folderList', 'body/obsah/obrazy/folders.php?browse=0&idFolder=', 'obrazy_list', 'body/obsah/obrazy/listBase.php?browse=0&idFolder=');
                                    dragDrop();
                                }
                            });
                        }
                    }
                }           
            }
        });

    }

    dragDrop();

    $('.folderListOnclick').click(function() {
        var append = 'idFolder='+$(this).attr('rel')+'&browse=0';
        ajaxElementCall('obrazy_list', 'body/obsah/obrazy/listBase.php?'+append);
        dragDrop();
        $('.trow1').css('background', 'transparent');
        $('.trow1').css('color', '#3e4245');
        $(this).parent().css('background', "#346cb6 url('img/menuButtonOver.png') left top repeat-x");
        $(this).parent().css('color', 'white');
    });

    $('.rootFolderListOnclick').click(function() {
        window.location = 'navigator.php?kam=obrazy';
        dragDrop();
    });

    $('.folderEditOnclick').click(function() {
        var append = 'idFolder='+$(this).attr('rel');
        showModal('modal_div', 'Editácia adresára'); 
        ajaxElementCall('modal_div', 'body/obsah/obrazy/folderEdit.php?kam=edit1&'+append);
    });

    $('.folderDeleteOnclick').click(function() {
        var append = 'idFolder='+$(this).attr('rel');
        showModal('modal_div', 'Vymazanie adresára'); 
        // TODO 0 Nemam sajnu, aka chyba je tuna - Eclipse mi tu hadze syntax error
        ajaxElementCall('modal_div', 'body/obsah/obrazy/folderDelete.php?kam=del1&'+append);
    });

    $('.addNewFolder').click(function() {
        showModal('modal_div', 'Nový adresár');
        var id = '';
        $('.folders .trow1').each(function() {
            if ($(this).css('backgroundColor') == 'rgb(52, 108, 182)' || $(this).css('backgroundColor') == '#346cb6') {
                id = $(this).attr('rel');
            }
        });
        ajaxElementCall('modal_div', 'body/obsah/obrazy/folderAdd.php?idFolder='+id);
    });

});    //-->
</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T07:36:30+00:00Added an answer on May 18, 2026 at 7:36 am

    Having looked at the whole code (and pasted it, minus the PHP content, into The Online Lint), I’d still say that there’s no syntax error in the Javascript, and that if that if Eclipse is telling you that there is, then Eclipse is wrong. Sometimes tools aren’t perfect.

    Does the code run, in different browsers? Chances are relatively good that if it does, then there’s not actually a syntax error there.

    (Posted as answer as requested. Ta.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can Java nest generics? The following is giving me an error in Eclipse: ArrayList<ArrayList<Integer>>
I have following code for which eclipse giving following compilation error: Multiple markers at
I don't know why I can't use the MultivaluedMap here, can someone help. Eclipse
Eclipse is giving me a warning of the following form: Type safety: Unchecked cast
(Eclipse 3.4, Ganymede) I have an existing Dynamic Web Application project in Eclipse. When
Eclipse issues warnings when a serialVersionUID is missing. The serializable class Foo does not
When Eclipse creates a new file ( .c or .h file) in a C
In Eclipse, I can switch through open editors using control-page up/down. This works great,
Some Eclipse plugins are mandated by your environment. The appropriate source code management plugin,
In Eclipse, I have a workspace that contains all of my projects. Each project

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.