Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Liferay 7 JSONP implementation
I have seen JSONP in a few examples of a remote client calling a LR JSONWS api from Javascript (jQuery $ajax call) Curiously, those examples never show the callback parameter passed nor do they confirm that it works. Confusing the issue further there are posts that say LR doesn't support JSONP and then some posts that say that they are supported after LR 6.1 + but I have yet to see a syntax example nor a confirmation that it actually works.
My specific issue is that if I append ?callback=myCallName to an existing jsonws api and receive the following:
"Refused to execute script from <my jsonws api url here> because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled."
A couple of different approaches produces the usual CORS issues so JSONP is really the only option.
Anybody have a working example of a JSONP call with an LR7 CE SB API call? I have seen some references to adding servlet filters and other additional programming solutions but they are also incomplete. I can't imagine that it would be THAT complex just to get JSONP to work...
Powered by Liferay™