ho il seguente codice nella visualizzazione MVC3:window.location.hash torna hash tag di fronte al valore
$(document).ready(function() {
if (window.location.hash) {
var manager= new Manager();
manager.doSomeStuff(window.location.hash);
}
});
La cosa interessante è che quando non c'è hash tag nell'URL, o c'è solo un esempio tag hash:
http://localhost:1223/Index/AboutUs
http://localhost:1223/Index/AboutUs#
Quando il window.location.hash
è vuota e la funzione non viene eseguita. Ma quando c'è un valore nel tag hash:
http://localhost:1223/Index/AboutUs#categoryId=5&manufacturerId=8
Il valore nel window.location.hash
è #categoryId=5&manufacturerId=8
si può spiegare a me perché il tag #
è incluso nel valore e perché quando non c'è valore dopo il tag #
, lo window.location.hash
è vuoto.
Sì, lo fa ??? – adeneo