0

I´m using Simrou javascript routing system

<a href="#!add"></a>

Using Simrou

var editRoute = router.addRoute('!:id');
editRoute.get(function(event, params) {
$this = params.id;
window[$this](); });

Which calls the "add" JS function correctly. So i end up having this url to call "add" function:

http://wwww.test.com/#!add

But JQuery throws this error:

Error: Syntax error, unrecognized expression: #!add

If i remove the "!" it works without errors, but the idea is to have the "!" following Google Ajax crawling. How can i fix this?

Thanks.

azost
  • 571
  • 11
  • 22
  • I dont have any JQuery inside the "add" function, but some JQuery libraries are loaded, do you think the problem is related with one? But without "!" everything works great. – azost May 10 '14 at 15:36
  • Have a look at this - http://stackoverflow.com/questions/70579/what-are-valid-values-for-the-id-attribute-in-html it answers your question. – Jay Blanchard May 10 '14 at 15:40
  • Also, any symbol following "#" will throw a error. Ex: "/", "&", etc. – azost May 10 '14 at 15:40
  • Hi. I´m still confused, based on the Google Ajax Crawling guide i need to add the exclamation mark to href, but adding the "!" will cause a Jquery error..what i´m missing? – azost May 12 '14 at 13:20

0 Answers0