SCRIPT5017: Syntax error in normal expression

1

When I run my application through Chrome or Firefox it works perfectly. But IE 10 at some point in the application gives this Javascript error.

**JavaScript critical error at line 99, column 86 in http://localhost:64146/VoucherRequest/ConfirmRequest?requestId=2862
SCRIPT5017: Erro de sintaxe em expressão normal**

// When I click this button, in IE, it gives the error message.

I researched and did not find anything enlightening about. I already checked the syntax, I already put the following tag in head

<meta http-equiv="X-UA-Compatible" content="IE=10" />

Anyway, it does not work on my IE. I need a light!

EDIT

VoucherRequest / ConfirmRequest

@model Request
@{
ViewBag.Title = "Requisição";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h1>
Requisição</h1>
<h2>
Passo 3:</h2>
<p>
Verifique os dados preenchidos e clique em concluir. Se alguma informação estiver
incorreta, clique em corrigir.</p>
<div class="form">
<div>
    <span class="title">Solicitante:</span><span class="field">@Html.DisplayFor(x => x.Usuario.Nome)</span>
</div>

    <span class="title">Observações:</span><span class="field">@Html.DisplayFor(x => x.Note)</span></div>

<table>
    <tr>
        <th>
            Funcionário
        </th>
        <th>
            Data
        </th>

        <th>
            Quantidade
        </th>
    </tr>
    @foreach (RequestItem item in Model.Items)
    {
        <tr>
            <td>
                @Html.DisplayFor(x => item.Usuario.Name)
            </td>
            <td>
                @Html.DisplayFor(x => item.Data)
            </td>

            <td>
                @Html.DisplayFor(x => item.Quantidade)
            </td>
        </tr>
    }
</table>
<div class="formfooter">
    <input type="button" value="Corrigir" onclick="[email protected]("EditRequest", new { requestId = Model.Id })" />
    <input type="button" value="Gerar pedido" onclick="window.open('@Url.Action("ProcessRequest", new { requestId = Model.Id })','_blank');window.location.href='@Url.Action("Index", "Home")'" /></div>

    
asked by anonymous 30.09.2014 / 20:19

1 answer

1

Apparently your links are being interpreted as a Regular Expression ("normal expression"? Seriously, Microsoft?). This is because the bars of the first link and those of the second complement each other. To illustrate, copy this snippet below in the Chrome console and hit enter to see how the string is:

'<input type="button" value="Solicitar" onclick="window.open(\'http://localhost:64146/VoucherRequest/ConfirmRequest?requestId=2862\',\'_blank\');window.location.href=\'http://localhost:64146/\'" />'

To fix, all I did was exchange the single quotation marks surrounding the url with double quotation marks, so the code of your .cshtml has to look something like this:

<input type="button" value="Solicitar" onclick='window.open("@Url.Action("ProcessRequest", new { requestId = Model.Id })","_blank");window.location.href="@Url.Action("Index", "Home")"' /></div>
    
01.10.2014 / 14:34