0

From this call

@using (Ajax.BeginForm("Manage", "Account", new AjaxOptions { HttpMethod = "POST", Confirm = "Você tem certeza que deseja salvar a alteração?", OnSuccess = "close" }))

the OnSuccess function is called and execute the following:

    function close(json) {
    $('"#' + json.param1 + '"').dialog("close");
    alert(json.Message);
}

and I get this error:

Error: Syntax error, unrecognized expression: "#UserSettings"

[Break On This Error]

throw new Error( "Syntax error, unrecognized expression: " + msg );

$('#UserSettings').dialog("close"); works fine so I don´t get why the error.

2 Answers 2

2

You do not need the extra double quotation marks in your jQuery selector. It should be:

$('#' + json.param1).dialog('close');
Sign up to request clarification or add additional context in comments.

1 Comment

No problem. The reason it was complaining was because it thought you were looking for $('"#UserSettings"') which is an invalid selector.
0

try

$('#' + json.param1).dialog("close");

The double-quotes I think is where you are having an issue.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.