GithubHelp home page GithubHelp logo

Comments (5)

cowboy avatar cowboy commented on July 24, 2024

I'm not sure what you're asking. Just like $.param.fragment( '/some/url.html', 'a=1' ) will try to merge fragment params "a=1" into url "/some/url.html" and return "/some/url.html#a=1", $.param.fragment( '', 'a=1' ) will try to merge fragment params "a=1" into url "" and return "#a=1".

And you probably shouldn't compare BBQ "params" fragments as strings, because in different browsers (since objects' property order is unsorted and not guaranteed) there's the possibility that the individual params could be encoded in different orders.

from jquery-bbq.

vvo avatar vvo commented on July 24, 2024

What i'm trying to explain is that .fragment have different behavior when you call it with no params :

if your url is http://google.com/#q=yes

$.param.fragment() return "q=yes" without the #

while $.param.fragment('', 'q=yes') will return #q=yes so i was thinking that the behavior was different.

from jquery-bbq.

cowboy avatar cowboy commented on July 24, 2024

That's the expected behavior, the documentation for jQuery.param.fragment states that the method returns:

The parsed fragment (hash) string, with any leading “#” removed.

from jquery-bbq.

cowboy avatar cowboy commented on July 24, 2024

I think I actually need to update the documentation for jQuery.param.fragment (build url) to indicate that it returns:

A URL with a urlencoded fragment (hash) in the format ‘#a=b&c=d&e=f’.

from jquery-bbq.

vvo avatar vvo commented on July 24, 2024

Ok thank you for your anwsers, this is now closed

from jquery-bbq.

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.