jQWidgets Forums

This topic contains 5 replies, has 3 voices, and was last updated by  Peter Stoev 9 years, 3 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Cross origin Posts
  • Cross origin #82200

    hankBrown
    Blocked

    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!

    Cross origin #82217

    Peter Stoev
    Keymaster

    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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Cross origin #82398

    hankBrown
    Blocked

    Thank 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.

    Cross origin #82407

    rajarammohan
    Participant

    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.

    Cross origin #82545

    hankBrown
    Blocked

    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?

    Cross origin #82547

    Peter Stoev
    Keymaster

    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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.