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

  • Home
  • SEARCH
  • 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 6129041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:41:46+00:00 2026-05-23T16:41:46+00:00

I have some javascript that i’m trying to use in a jsf app. I’ve

  • 0

I have some javascript that i’m trying to use in a jsf app. I’ve narrowed it down so that if I take out the lines below, things work fine, but when I have these lines in, I get an error in the chrome console which says “unexpected ;” and it shows the first line as if(maxdays > 1000) {

Why is it converting the greater than symbol to >?

if(maxdays > 1000) {
    maxdays = 1000;
}

EDIT:
Here’s the entire JSF page.

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich">


<h:head>


    <title>Protocol Dashboard</title>
    <link type="text/css" rel="stylesheet" href="../css/styles.css" />
    <script type="text/javascript" src="../js/jquery-1.5.2.js"></script>
    <script type="text/javascript" src="../js/highcharts.src.js"></script>
    <script type="text/javascript">
        $(document).ready(
                function() {
                    //var chartData;
                    //var goodData;
                    var chart;
                    var studyType;
                    var categories;
                    var maxdays;
                    //var chart = new Highcharts.Chart({
                    var options = {

                        chart : {
                            renderTo : 'container',
                            type : 'bar'
                        },

                        title : {
                            text : 'Gantt module development plan'
                        },
                        subtitle: {
                            text: studyType
                        },
                        xAxis : {
                            categories : [ 'Planning', 'Development',
                                    'Testing', 'Documentation' ]
                        },

                        yAxis : {
                            type : 'datetime',
                            min : Date.UTC(2012, 0, 1),
                            labels : {
                                formatter : function() {
                                    return Highcharts.dateFormat('%m/%d/%Y',
                                            this.value);
                                }
                            }

                        },

                        tooltip : {
                            formatter : function() {
                                var point = this.point;
                                return '<b>'
                                        + point.category
                                        + '</b><br/>'
                                        + Highcharts.dateFormat('%b %e, %Y',
                                                point.low)
                                        + ' - '
                                        + Highcharts.dateFormat('%b %e, %Y',
                                                point.y);
                            }
                        },

                        series : [ {
                            data : [ {
                                low : Date.UTC(2012, 0, 1),
                                y : Date.UTC(2012, 0, 15)
                            }, {
                                low : Date.UTC(2012, 0, 10),
                                y : Date.UTC(2012, 4, 28)
                            }, {
                                low : Date.UTC(2012, 3, 15),
                                y : Date.UTC(2012, 4, 28)
                            }, {
                                low : Date.UTC(2012, 4, 15),
                                y : Date.UTC(2012, 4, 28)
                            } ]
                        }, {
                            data : [ {
                                low : Date.UTC(2012, 0, 1),
                                y : Date.UTC(2012, 1, 15)
                            }, {
                                low : Date.UTC(2012, 0, 10),
                                y : Date.UTC(2012, 3, 15)
                            }, {
                                low : Date.UTC(2012, 3, 15),
                                y : Date.UTC(2012, 6, 14)
                            }, {
                                low : Date.UTC(2012, 4, 15),
                                y : Date.UTC(2012, 4, 25)
                            } ]
                        } ]

                    };

                    function loadData() {

                        //options.series.length = 0;
                        //options.xAxis.categories.length = 0;

                        $('#hiddenData').val('09-034,99|10-053,194');
                        $('#hiddenCategories').val('09-034|10-053');
                        $('#clickedMenu').val('P2C');
                        $('#hiddenMaxDays').val('194');



                        var chartData = $('#hiddenData').val();
                        console.log('hiddenData = '+chartData);

                        categories = $('#hiddenCategories').val();
                        console.log('hiddenCategories = '+categories);

                        studyType = $('#clickedMenu').val();
                        console.log('clickedMenu = '+studyType);

                        maxdays = $('#hiddenMaxDays').val();
                        console.log('hiddenMaxDays = '+maxdays);
                        console.log('maxdays = '+maxdays);



                        //options.yAxis.max = maxdays;

                        options.subtitle.text = studyType;

                        var goodData = chartData.split('|');
                        //console.log('goodData = '+goodData);

                        //var goodCategories = categories.split(",");
                        //console.log('goodCategories = '+goodCategories);
                        /*
                        var series = {

                            data : []
                        };

                        var cat = {
                            categories : []
                        };

                        try {
                            $.each(goodData, function(index, value) {
                                var goodData2 = value.split(",");
                                //series.name = goodData2[0];
                                series.data.push(parseFloat(goodData2[1]));

                            });

                            $.each(goodCategories, function(index, value) {
                                var prot = value;
                                options.xAxis.categories.push(value);

                            });

                            options.series.push(series);
                            //console.log(options);
                        } catch (err) {
                            //console.log("ERROR ..." + err.description + '  message:'
                            //+ err.message);

                        }*/

                    }

                    function loadDataAndCreateChart() {
                        loadData();
                        //console.log(options);
                        chart = new Highcharts.Chart(options);
                    }

                    loadDataAndCreateChart();

                });
    </script>

</h:head>
<h:body>

    <div id="container"></div>

    <h:inputHidden value="#{selectCategory.jsonResults }" id="hiddenData" />
    <h:inputHidden value="#{selectCategory.jsonResultsCategories }" id="hiddenCategories" />
    <h:inputHidden value="#{selectCategory.menuItem}" id="clickedMenu" />
    <h:inputHidden value="#{selectCategory.maxDays}" id="hiddenMaxDays" />

</h:body>
</html>
  • 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-23T16:41:46+00:00Added an answer on May 23, 2026 at 4:41 pm

    You’re using Facelets, which is a XML based view technology. JavaScript operators like >, &, etc are special characters in XML and are illegal when used for other purposes inside a XML file. Facelets is taking care of them this way.

    I strongly recommend to put all that JS code in its own .js file and reference it by a <script src> or a <h:outputScript>.

    E.g.

    <script src="#{request.contextPath}/js/global.js"></script>
    

    or

    <h:outputScript name="js/global.js" />
    

    Additional advantage is that you can finetune browser caching this way and end up in a more efficiently served website.


    Unrelated to the concrete problem: please note how I referenced the libraries. You should prefer domain-relative paths over URI-relative paths. Using ../ is a maintenance pain. If you move the view or change the request URI, it’ll break.

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

Sidebar

Related Questions

I have some javascript that I'm trying to retool using jQuery to learn the
I have some javascript that goes out and fetches a javascript class on another
I have some javascript that should log a user out after a certain period
I have some jQuery/JavaScript code that I want to run only when there is
I have problem in some JavaScript that I am writing where the Switch statement
I have a view using a master page that contains some javascript that needs
I have some code in a javascript file that needs to send queries back
I need to have some information about the scoping in JavaScript. I know that
I have a javascript function (function1) that checks some global variables (can the user
I have some Javascript that is opening a blank window, assigning it with a

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.