in Education by
I am using a framework, which returns invalid JSON String like: /* { "myobject" : "test"} */ The error is the comments before and after the json string. This has been invented for security reasons. As the www says returning JSON directly is somehow discouraged because it can be exploited. I am not a security expert at all but would like to go conform with this recommendation. However, now I get this string above with header type "application/json" Can I somehow hook into jQuery and tell it to remove /* */ from the json string by default? thanks, Christian JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I found a solution with converters. http://api.jquery.com/extending-ajax/#Converters

Related questions

0 votes
    I have a function foo which makes an asynchronous request. How can I return the response/result from foo? I am trying to ... (response) { result = response; // return response; //...
asked Apr 16, 2022 in Education by JackTerrance
0 votes
    I have a function foo which makes an asynchronous request. How can I return the response/result from foo? I am trying to ... (response) { result = response; // return response; //...
asked Apr 14, 2022 in Education by JackTerrance
0 votes
    Which of these method of class String is used to remove leading and trailing whitespaces? (a) startsWith() ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    How will you remove all leading and trailing whitespace in string?...
asked Nov 26, 2020 in Technology by JackTerrance
0 votes
    I have succeed implement this code to remove product from cart with Ajax. But it didn't works with ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 30, 2022 in Education by JackTerrance
0 votes
    I'm looking for a way to remove trailing slash for all WordPress URL's. I found similar answers ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 7, 2022 in Education by JackTerrance
0 votes
    I'm looking for a way to remove trailing slash for all WordPress URL's. I found similar answers ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    How can I remove the last character of a string in a newline, In perl I used chomp function what's equivalent to that in Python? Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    Can We use comments inside a JSON file? If so, how?...
asked Jan 11, 2021 in Technology by JackTerrance
0 votes
    In Eclipse, is there any way, e.g., built-in functionality or short cuts of Eclipse, to REMOVE ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    When working with Ajax applications, which is faster, XML or JSON? A. XML, because it is extensible B. JSON, ... D. JSON, because it is already parsed into a JavaScript object...
asked Mar 10, 2023 in Technology by JackTerrance
0 votes
    I am using the following function to load a PlayList of Songs from 'PlayListJSON.aspx' but somethings seems ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    First I'll explain my senario: I have a page in which users login or register. The login control ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 10, 2022 in Education by JackTerrance
0 votes
    I have a POST request that passes data to my database when the form is submitted. Photo of what I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 14, 2022 in Education by JackTerrance
0 votes
    I have a POST request that passes data to my database when the form is submitted. Photo of what I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 13, 2022 in Education by JackTerrance
...