What is equivalent to making this call eval('('+responseText+')')in jQuery? I also understand that it is evalnot so safe, so I am looking for something more secure and more idiomatic in jQuery.
eval('('+responseText+')')
eval
Do you really want to execute Javascript code (which will be unsafe to some extent), or are you trying to parse JSON from a string into an object?
If the first, eval () will still be your best bet.
, jQuery AJAX, JSON plug-in .
a) JS-:
$.getScript( url, [ success(data, textStatus) ] )
. http://api.jquery.com/jQuery.getScript/
b) JSON:
$.parseJSON( json )
. http://api.jquery.com/jQuery.parseJSON/
, . . , , , Firefox undefined, IE6 TypeError.
By design, jQuery intends to improve browser implementation. Since there is no problem with how various browsers implement it eval, it is not processed by jQuery.
$.globalEval()?
$.globalEval()
http://api.jquery.com/jQuery.globalEval/
The documentation says that it behaves very differently than eval(), but its closest match is if you want to pass your grades through jQuery.
eval()
Source: https://habr.com/ru/post/1703922/More articles:Incorrect MSP 430 Values Displayed - cLaunch JBoss AS 5 and JBoss AS 4 at the same time - jbossHow can I avoid large multi-stage unit tests? - c #How to remove an event listener from an anonymous component? - flexIs the supplier model an IOC implementation? - design-patternsflash AS3 how to remove scene listeners - flashPyQt4: data binding? - pythonРезультаты поиска и форматирования - language-agnosticreverse perspective - mathМетод перегрузки Стоимость в .Net - methodsAll Articles