Script giving syntax error after ;

Asked

Viewed 61 times

2

This script gives error:

<script>
        $(document).ready(function () {
            $('#dataSolicitacao').datepicker({
                format: "DD/MM/yyyy",
                language: "pt-BR",
                minViewMode: 0;
        orientation: auto
    });
  });
</script>

Gives semicolon error after line minViewMode: 0; saying that missing a key } And then there’s an error in that last key minViewMode: 0; saying syntax error.

How do I fix this script?

  • 2

    change the semicolon by comma.

2 answers

6


There is an improper semicolon inside the initialization of the object. Just change it by comma and the problem is solved:

<script>
    $(document).ready(function() {
        $('#dataSolicitacao').datepicker({
            format: "DD/MM/yyyy",
            language: "pt-BR",
            minViewMode: 0,
            orientation: auto
        });
    });
</script>

I put in the Github for future reference.

3

<script>
$(document).ready(function () {
    $('#dataSolicitacao').datepicker({
        format: "DD/MM/yyyy",
        language: "pt-BR",
        minViewMode: 0,
        orientation: auto;
    });
});
</script>

The problem is that after the minViewMode you were putting a semicolon.

  • Responding to Bigown and Leonardo. I had already done this and it didn’t work. The date keeps coming in the American standard.

  • Leonardo, the semicolon after the auto gives syntax error.

  • @pnet It seems to me that the problem has been solved, right? The fact that you have another problem now means that you need another question. If you do I try to answer. You know how it works, accept this (the answer that solved the problem) and create a new one.

  • This question was asked in the wrong way. I already have another question. I asked the question, but thinking of another answer. Okay, I’ll take it because I asked the question wrong. That’s not what I was looking for. There are two equal answers.

  • In the other question you asked a similar thing.

  • @pnet there are no two equal answers, one works and the other continues to give problem, just changed place. For once a wrong answer is getting votes.

  • @bigown did not see that I had posted an answer and on the point and comma I did not heed and put at the end (mania). About replying to "earn points", I’m not here for this. I’ve been very helped by pt.SO, for me points makes no difference at all. :)

  • 1

    @Leonardocoelho, ok, by the rule of the forum I will reply and close the post, but ok. Thanks for the feedback and your comment was timely.

Show 3 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.