firefox not executing javascript on back button

יום שלישי, ספטמבר 6, 2011

Hi, firefox has a cache behavior that uses in-memory caching for entire Web pages, including their JavaScript states, for a single browser session. This can cause to unexpected javascript and HTML behavior when pressing on the browser back button. For example: PageLoad will not fired javascript code will not executed DHTML that was created by JavaScript will be shown and more... In case firefox cache is something you want to prevent, Below are some common programmatic reasons that a page will not be cached by firefox: the page uses an unload or beforeunload handler the page sets "cache-control: no-store" the page sets "cache-control: no-cache" and the site is HTTPS. the page is not...

ASP.NET MVC Razor CSS and Javascript Compress and Manager

יום שני, אוגוסט 8, 2011

Hi, If you are ASP.NET MVC Razor developer and you are looking for a nice solution to Combine, Compress and Manage your CSS and JavaScript files, Well SquishIt can fit your needs. Razor Code Sample: @MvcHtmlString.Create(  SquishIt.Framework.Bundle.Css()    .Add("~/media/css/reset.css")    .Add("~/media/css/style.less")    .Add("~/media/css/handheld.css")    .Render("~/media/css/combined_#.css"))@MvcHtmlString.Create(  SquishIt.Framework.Bundle.JavaScript()    .Add("~/media/js/geo.js")    .Add("~/media/js/jquery-1.4.4.js")    .Add("~/media/js/jquery.unobtrusive-ajax.js")    .Add("~/media/js/jquery.validate.js")    .Add("~/media/js/jquery.validate.unobtrusive.js")    .Render("~/media/js/combined_#.js")) Output looks like this:<link rel="stylesheet" type="text/css" href="/media/css/combined_312454.css" /><script type="text/javascript" href="/media/js/combined_312454.js"></script> You can read more here. We are using SquishIt on the company I work and it look like a really nice and useful solution. I hope you will find it useful on your company or project also :-) Yours, Rotem

Jquery TreeView with RTL support

יום שישי, אוקטובר 15, 2010

Hi All, Well after month of silent (7 I think) I got back with a new post on Jquery TreeView. First you can download the plugin from here. I must say this plugin is amazing very fast even with large trees. The problem of Jquery TreeView is the lack of RTL (Right To Left) support for languages like: Hebrew, Arabic etc... If you got the same problem I have and you need Jquery TreeView RTL version you can download it from my blog right here. To the AJAX fans I also add a nice cool ajax application example you can download it from here. Hope it helps Cheers Rotem

How to change ASP.NET CheckBox control Enabled property using javascript. bug or behavior?

יום רביעי, דצמבר 31, 2008

Changing status to enabled\disabled for regular input type checkbox in javascript is very simple. You just need to use the javascript code:var checkBox = document.getElementById("chkToTest"); checkBox.disabled = true\false; Well try to use this javascript code above on ASP.NET checkbox web control when you set the server side Enabled property to false like below: chkToTest.Enabled = false; I'm telling you it will not work!!!! Do you ask how to solve this bug or behavior? You just need to set the disabled property of the parent node also. something like this:var checkBox = document.getElementById("chkToTest"); checkBox.disabled = true; checkBox.parentNode.disabled = true; I don't know why but when setting the Enabled property of ASP.NET...

Cross site Ajax plugin for Prototype

יום שלישי, דצמבר 2, 2008

Thierry Schellenbach has implemented a Prototype plugin that allows you to do cross site remoting using the dynamic script tag method that other frameworks such as Dojo and jQuery have supported for awhile.You can implement this by simply setting crossSite: true as a config parameter to Ajax.Request.Code example:new Ajax.Request('myurl', {method: 'GET',crossSite: true,parameters: Form.serialize(obj),onLoading: function() {//things to do at the start},onSuccess: function(transport) {//things to do when everything goes well},onFailure: function(transport) {//things to do when we encounter a failure}});the full information can be found on Thierry Schellenbach blog

JS Script Get Element Position With Scroll Support

יום שלישי, נובמבר 25, 2008

Well, I was looking on the web for JavaScript fuction that return any DOM element position and also consider browser scroll. I finally came up with the solution and wanted to share it with you. In order that the script will work you need reference to Prototype JavaScript Framework. Well here is the JavaScript code:function getDocumentWindow(doc) {     return (doc.parentWindow || doc.defaultView); } function getPosRelativeToWindow(element, topWindow, considerScrollOffset) {    var l = 0, t = 0;    var pos, doc, w, lastWindow;    topWindow = topWindow || top;   while (element) {        doc = element.ownerDocument;      w = this.getDocumentWindow(doc);       lastWindow = (!w || w == topWindow);     if (lastWindow)         ...