Archive for May, 2011
How to set a delay in Javascript
May 31st
Writing a simple delay is quite simple in Javascript.
I’m not a Javascript guru…. or any other type of guru. Often times while working on something I just come across a certain scenario that needs a tweek or a small problem to solve.
So while writing some code to create on inline editing (in a data grid for example) I had some JS functions that would load my form to replace the data, submit the form in the background (POST HTTP request…). Problem was when the data grid’s cell would reload it would actually reload the old data. The update was taking just a touch longer then the function that was requesting the row’s data.
Every thing was firing in the proper order. I just needed to delay the function that would reload the grid’s row.
At first I thought I could do something like this:
$(“#divToReload”).delay(500).load(reloadURL);
I figured the delay should work. But I believe, the delay function is better suited for animations… fades and such.
(Also, I am using jQuery)
So I set a timeout function to initiate the jQuery function which worked perfectly.
setTimeout(function() {$(“#divToReload”).load(reloadURL);},500);
How to Fix Skype crash (APPCRASH) in Windows 7
May 26th
So today when I logged into the computer to start work I had a most unpleasant surprise.
That being that Skype was unable to start. I use Skype a whole bunch in my “day to day” work activities. It’s how I keep in contact with my current “work team”.
Looking into the details, the message was APPCRASH. I didn’t have much to go on and I cleaned off the computer as I thought it may have something….. which it did. Some spy-ware and malware. I believe it may have picked some up from some “Girls games” sites my daughter plays on from time to time.
Anyways, cleaning this thing off didn’t do anything.
Eventually, I found Aasim Naseem Siddiqui’s blog and the answer was there. There are directions for fixing this for Windows 7, Mac OSx, XP and Linux.
Thank you so much Aasim!
I will post the Windows 7 solution here.
Find and delete the shared.xml file in the Skype data folder located here:
C:\Users\%username%\AppData\Roaming\Skype
Restart Skype and there you have it. Worked fine for me. Skype likely shouldn’t be running if you do this… but if you have this problem, Skype probably isn’t running anyways right???
Once again, Thanks to Aasim for posting this on his blog. And for the other OS fixes, please visit his blog:
http://aasims.wordpress.com/2011/05/26/how-to-fix-skype-crash/
Need form submission to break out of an iFrame?
May 5th
I’m kind of posting this for my own memory.
From time to time I come across these situations where there is a simple answer but I simply have not done before or can’t remember.
So, here was the scenario:
I had an iFrame on a website that loaded some dynamic content and did some processing in the background (and yes, it had to be done this using, using 3rd party software API)…. this iFrame then presented a form with a couple of options.
What I found out after creating the form and functionality to handle the “stuff” in the iFrame was that the form submission and the next page load were being presented within the iFrame… which maybe I could do a little work around, but it wasn’t the best or cleanest way to accomplish what was desired.
So, after a little help from “my friend Google“, I found that it was nice and easy. I added an onclick attribute with my submit button… and voila it worked!
Here’s an example of what worked:
<input type=”submit” value=” Freedom! ” onclick=”this.form.target=’_top’” />
