I tried to avoid a single quote when preparing a request in JS as follows:
_value.replace(/'/g,'%27')
and as follows:
_value.replace(/\'/g,'\\\'');
both do not work
Here you can see an example: http://services.odata.org/V3/Northwind/Northwind.svc/Orders ? $ select = Freight, CustomerID & $ filter = ShipName + eq + 'B's% 20Beverages' & $ format = json
Does anyone know how to avoid a single quote?
thanks
a single quote should be doubled, for example:
ShipName+eq+'B''sBeverages'
instead
ShipName+eq+'B'sBeverages'
This code is used to replace a single quote ... Its working.
_value.replace(/'/g, '%27%27')
Source: https://habr.com/ru/post/955769/More articles:How to write the name and value of a variable? - variablesC # Select a random item from a list - c #Iterate over two arrays simultaneously using for each loop in Java - javaLua "== true equals" "== false - luaComposite components with composite children, mixing values ββwhen used with ui: repeat - faceletsUIInterpolatingMotionEffect works randomly - iosMFMailComposeViewController ignores some of the UIAppearance protocols in iOS 7 - iosAppearance of MFMailComposeViewController setTintColor is lost iOS 7 - iosHow to avoid seams between the filled areas in the canvas? - canvasRetain SVG attribute at final value after animation - animationAll Articles