Giter VIP home page Giter VIP logo

Comments (7)

elia avatar elia commented on June 9, 2024

You think you can prepare a PR for this (and #44)? ๐Ÿ˜ธ

from opal-jquery.

elia avatar elia commented on June 9, 2024

@lloeki I was looking into this and realized that seems to be more an issue between jQuery and Rails than something specific to opal-jquery. Is that correct?

If that's true maybe you're good to go with the official global ajax setup:
http://api.jquery.com/jQuery.ajaxSetup/

from opal-jquery.

lloeki avatar lloeki commented on June 9, 2024

@elia yeah you're right at a technical level. That's why I was reluctant to make any patch.

For a user point of view there is a high chance opal-jquery will be used with Rails. I suppose a little note in the doc/examples regarding dataType may shed quite a useful light. Alternatively, wrapping the ajaxSetup facility or even better, providing a similar yet idiomatic system in pure opal could be great. Thoughts?

from opal-jquery.

elia avatar elia commented on June 9, 2024

I like the latter option, something like this should look good:

HTTP.configure(
  url: "/xmlhttp/",
  global: false,
  type: "POST"
)

# or

HTTP.setup(
  url: "/xmlhttp/",
  global: false,
  type: "POST"
)

maybe we can keep both with an aliasโ€ฆ what do you think?

from opal-jquery.

elia avatar elia commented on June 9, 2024

or even

HTTP.setup = {
  url: "/xmlhttp/",
  global: false,
  type: "POST"
}

and the getter

HTTP.setup # => { url: "/xmlhttp/", global: false, type: "POST" }

from opal-jquery.

elia avatar elia commented on June 9, 2024

@lloeki for the Rails side I wonder if it's something that should be backed into jquery_ujs.js itself

from opal-jquery.

lloeki avatar lloeki commented on June 9, 2024

I like the setup accessors, it bridges well with jQuery and doesn't look awkward in ruby.

HTTP.configure begs for the idiomatic configuration DSL by way of a block. It may be useful to set up properties that pertain to the wrapper itself (along with those that act directly on jQuery, but in a more DSL way)

from opal-jquery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.