您好我正在尝试从我的 grails 控制器向 javascript 函数发送数据。我已经使用了 escape() 但它没有帮助。以下是 Fiddler 展示的内容。我想是导致问题的换行符..
控制器:
render(text:content, contentType: "text/javascript")
数据:
addPestMarker( 6, escape('White Fly'), escape('Bemisia tabaci ') , escape( 'N/A'), escape(' N/A'), escape('N/A'), escape('Install sticky fly traps.'), escape('Nymph measures to 0.3-0.8mm long. Size is about 1mm long with wings. They possess arrhenotoky where unfertilized eggs produce male flies while fertilized eggs produce female flies. Each female can produce 200 eggs in her life time. For whiteflies, development period takes 30 to 40 days depending on temperature.'), '35.0', '70.0','null', 'null');