Is there some explanation as when executing the following :
location.hash = "#/";
it works well in firefox (19.0.2) but not in IE (10.0.92).
In firefox it returns to the "homepage", whereas in IE it does nothing. No error shown either.
this code comes from this function :
self.addStoreItem = function () {
var data = appFsMvc.utility.serializeObject( $("#StoreItemForm") );
$.ajax({
url: "/api/StoreItems",
data: JSON.stringify( data ),
type: "POST",
dataType: "json",
contentType: "application/json"
})
.done(function () {
toastr.success( "You have successfully created a new StoreItem!", "Success!" );
self.StoreItems.push(data);
location.hash = "#/";
})
.fail(function () {
toastr.error( "There was an error creating your new StoreItem", "<sad face>" );
});
};
and the code to manage sammy.js :
appFsMvc.App = function( StoreItemsViewModel ) {
return $.sammy( "#content", function () {
var self = this;
this.use( Sammy.Cache );
this.StoreItemViewModel = StoreItemsViewModel;
this.renderTemplate = function ( html ) {
self.$element().html( html );
ko.applyBindings( self.StoreItemViewModel );
};
// display all StoreItems
this.get( "#/", function() {
this.render("/Templates/StoreItemDetail.htm", {}, function ( html ) {
self.renderTemplate( html );
});
});
// display the create StoreItems view
this.get( "#/create", function() {
this.render("/Templates/StoreItemCreate.htm", {}, function ( html ) {
self.renderTemplate( html );
});
});
});
};
Developers tool of IE do not show any errors.
the console of firebuglite is giving me these hints :
[Thu Mar 21 15:38:11 UTC+0100 2013] #content runRoute get /#/create
GET /Templates/StoreItemCreate.htm 200 OK 5ms
POST /api/StoreItems 200 OK 7ms
whereas doing the same in Firefox gives me :
[Thu Mar 21 2013 15:40:41 GMT+0100] #content runRoute get /#/create
GET http://myLocalHost:9501/Templates/StoreItemCreate.htm 200 OK 1ms
POST http://myLocalHost:9501/api/StoreItems 200 OK 27ms
[Thu Mar 21 2013 15:40:46 GMT+0100] #content runRoute get /#/
I can see in IE the url in the adress bar giving the correct url http://localhost:9501/#/create and then http://localhost:9501/#/ after posting my form.
if you need some more code, just tell me.
Thanks for reading,
Yoann
--
You received this message because you are subscribed to the Google Groups "Sammy.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sammyjs+u...@googlegroups.com.
To post to this group, send email to sam...@googlegroups.com.
Visit this group at http://groups.google.com/group/sammyjs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
for example URL: www.mysite.com/#/index
var app = $.sammy(function() {
this.get('#/index', function() {
init();
});
});
function int(){
alert('testing');
}
In firefox and chrome i am getting alert message, but in IE its not working and i am not getting any error also. Any can one help for me?
this.get('#/index', function() {
init();
});
harpreet bhatia
Freelance Web Application developer Technical reviewer (Codeigniter 2 cookbook) | w: http://harpreetbhatia.me| e: smstoh...@gmail.com | m: +91.9457634410
|
-- sent from Ubuntu
--
You received this message because you are subscribed to the Google Groups "Sammy.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sammyjs+u...@googlegroups.com.
To post to this group, send email to sam...@googlegroups.com.
Visit this group at http://groups.google.com/group/sammyjs.
(function($) {
var app = $.sammy(function() {
this.get('#/index', function() {
init();
});
});
function int(){
alert('testing');
}
$(function() {
app.run()
});
})(jQuery);
need to change anything? pls advise. its urgent
$(document).ready(function() {
var app = $.sammy(function() {
this.get('#/index', function() {
init();
});
});
$(function() {
app.run()
});
});