Suppress URL updating

When I ask for a session from a standard, generated model, it is updating the URL’s hash. I don’t want this.

I am not using can.route or pushstate.

I can’t see any place that this is being done.

Thoughts, please?

What does “session from a standard, generated model” mean. Generated models don’t have sessions afaik.

It’s a session created by a session model that was generated by your generator. It is close to unchanged.

I intended to tell you that the code is pretty much entirely from donejs. Sorry if I was confusing.

The behavior results from a that uses the default AJAX code and paths. In fact, I cribbed the call from bit balls.

var sessionPromise = this.attr("loginSession").save().then((session)=>{...

But it updates the URL with a hash and I can’t see why.

If you remove that bit of code, does the hash no longer change? What does the hash change to, by the way?

If I remove that bit, the hash doesn’t change, but neither do I get the AJAX call that retrieves the session data.

The data being put in the URL hash is a url encoded version of the data that comes back from the AJAX call.

The App model, which is loaded in via <can-import from="../app" export-as="viewModel" />, becomes the can.Map constructor used for making the can.Map for can.route.

All properties on the App model are coerced into strings. It will be the top ViewScope reference, as well as %root.

If you set properties on this, via cross-binding or otherwise, those properties will be serialized in the url unless explicitly set to do otherwise via define/serialize.

@Bajix, Thanks an entire ton!!


Even better. I previously had no idea what “serialize” was referring to. I never made a connection between serialize and the URL hash. Much appreciated.