Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Replacing term "hashtag" with "hash mark" to prevent spread of misinformation #357

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions chapters/03-internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ var view = new View();

## Routers

In Backbone, routers help manage application state and connect URLs to application events. This is achieved using hash-tags with URL fragments, or using the browser's pushState and History API. Some examples of routes may be seen below:
In Backbone, routers help manage application state and connect URLs to application events. This is achieved using hash marks ("#") with URL fragments, or using the browser's pushState and History API. Some examples of routes using the hash mark may be seen below:

```javascript
http://example.com/#about
Expand Down Expand Up @@ -1140,7 +1140,7 @@ var TodoRouter = Backbone.Router.extend({
var myTodoRouter = new TodoRouter();
```

As of Backbone 0.5+, it's possible to opt-in for HTML5 pushState support via `window.history.pushState`. This permits you to define routes such as http://www.scriptjunkie.com/just/an/example. This will be supported with automatic degradation when a user's browser doesn't support pushState. In this discussion we'll continue using the hashtag method.
As of Backbone 0.5+, it's possible to opt-in for HTML5 pushState support via `window.history.pushState`. This permits you to define routes such as http://www.scriptjunkie.com/just/an/example. This will be supported with automatic degradation when a user's browser doesn't support pushState. In this discussion we'll continue using the hash method.

**Is there a limit to the number of routers I should be using?**

Expand Down
2 changes: 1 addition & 1 deletion chapters/09-modular-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ A sample implementation is provided below. The `config` object would need to con

### Using NodeJS to handle pushState

`window.history.pushState` support (serving Backbone routes without a hashtag) requires that the server be aware of what URLs your Backbone application will handle, since the user should be able to enter the app at any of those routes (or hit reload after navigating to a pushState URL).
`window.history.pushState` support (serving Backbone routes without a hash mark) requires that the server be aware of what URLs your Backbone application will handle, since the user should be able to enter the app at any of those routes (or hit reload after navigating to a pushState URL).

Another advantage to defining all routes in a single location is that the same JSON configuration file provided above could be loaded by the server, listening to each route. A sample implementation in NodeJS and Express:

Expand Down