Friday, August 24, 2018

How to avoid slash before hash?

I'm using the jquery-router-plugin and run into a problem. I've created a Link tag with a hashbang like this:

Click

and added this route (mainContent is a simple div):

$.router.add('/hello/:foo', function(data) {
    $("#mainContent").html("Hello "+data.foo+"!");
});

The problem is that the browser calls this (not working):

http://{url}/#!/hello/world

instead of this (working)

http://{url}#!/hello/world

How can I get the Browser to use the working URL?

EDIT 1:

When I click the link it calls:

http://localhost/#!/hello/world

But it has to call:

http://localhost#!/hello/world

No comments:

Post a Comment