jQWidgets Forums
jQuery UI Widgets › Forums › General Discussions › Cross origin
This topic contains 5 replies, has 3 voices, and was last updated by Peter Stoev 9 years, 3 months ago.
-
AuthorCross origin Posts
-
Aw phooey. jqwidgets does not send OPTIONS for cross origin requests with credentials?
Looks like the stock answer is “go read the dataAdapter page”.
And the stock example is view-source:http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/bindingtojsonp.htm?arctic
In this day and age, why are we still jumping through these hoops? I had expected to set a property to enable CORS.
The sample shows nothing of the server side? I already have a server side in php that honours and processes OPTIONS.
Eg isset($_SERVER[‘REQUEST_METHOD’]) AND $_SERVER[‘REQUEST_METHOD’]==’OPTIONS’ AND isset($_SERVER[‘HTTP_ORIGIN’])…
My memory of JSONP is dim. I find no php samples for jqwidgets. What is it we need to do on a php server to respond correctly to jsonp requests?
I do not yet make sense of the adapter docs. Long page with too much information on many topics.
Looks like they changed datatype from json to jsonp in the source object, then added this puppy:
$.extend(data, { featureClass: "P", style: "full", maxRows: 50 });
Ok so I’ll go looking up jquery extend. But I don’t think this is my answer.
Aggravating. Seems like it should be easier to use widgets across sub domains.
Appreciate any hints, thanks.
My problem is coming from extJS where this was magically done. Zero jquery background. So I’m a little unsure where to dig further. Looks like jqwidgets ONLY supports jsonp for CORS. It will never be possible to send OPTIONS. Do I have that right?
Thanks!
Hi hankBrown,
The sample does one thing – demonstrates how to bind a widget using JSONP data source. It’s not supposed to have server code there and if you look at the sample you will notice that, we do not bind it to a source hosted by our company so we cannot show the server code. Even in the code you posted with $.extend is demonstrated that Sending Options is possible through JSONP.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comThank you for your reply.
Please let me try to make the question simpler.
Is it possible to use jqwidgets for cross-domain calls without JSONP?
I am asking because my server-side is already coded for ajax calls with the pre-flight OPTIONS and credentials
(eg http://techblog.constantcontact.com/software-development/using-cors-for-cross-domain-ajax-requests/ )
If I must switch to JSONP, I must also write and debug extra code to do what is already working and tested.
Not a jquery guy here, but their docs seems to indicate they support pre-flight requests with credentials.
At this time I cannot guess if/how that plays nice with jqwidgets.
I hope this is clearer. Thank you.
I think you should try word press there has so many themes like divi and i ll make sure that it halp you alot and make your site very attractive and hilarious.
Do the answers get any more helpful if you buy the product?
Does anyone else understand what I am asking?
Has anyone implemented jqwidgets cross domain without JSONP ?
Has anyone adapted jquery/jqwidgets to use the OPTIONS protocol instead?
Hi hankBrown,
I do not see anything wrong with my answer. We support JSONP and we demonstrated using our widgets with JSONP. We also send options through JSONP as shown in these samples. If there are other approaches, that’s fine. However, we cannot have an example and support for everything, even if we try.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.