An alternative to cross-domain AJAX, sort of

Recently, I got a project to make an ad system for a website. The ad system was such that, when the page displaying ad was loaded for the first time, it would create a random link and store them in database. From then on, it would display the same link on same page.

So, I made a javascript file which would create and xmlobject for AJAX request. It would query php file on a server and get the link. But cross domain AJAX just doesn’t work. I tried to edit some parts of it, but it just wouldn’t work. Cross domain ajax requests aren’t allowed for security purposes.

So I had to think of something else. First I thought of renaming php file to js and then addind a code to .htaccess to make it behave like php. Then I thought of making image links dynamically using php’s GD library.

So, I was just surfing the net, procrastinating the job when I stumbled across:

http://www.javascriptkit.com/javatutors/externalphp.shtml

It just solved all my problems. So I just added a header for executing it as javascript and modified the echo commands to display javascript commands. Now I needed a client-side code for displaying the links. That was problematic too. I needed the source of the javascript file to be dynamic. It was just not working. But I finally found a solution by posting it on phpfreaks.com.

http://www.phpfreaks.com/forums/index.php/topic,251815.0.html

There you go.

If you want to know more details, just add a comment here.

Freed up some MBs, finally!

My computer was infested with more than 150 softwares, majority of which were used only once or twice and hadn’t been in use since then. I was just too lazy to uninstall them. I was not facing any performance issues despite of so many programs installed on computer but today my notebook was really lagging. I was also struggling with free HDD space. Let me tell you that I am a download freak. I feel incomplete when my download manager is empty and I search for something to download. I just don’t like my download manager sitting idle in the task bar which was the main reason I was struggling with low HDD space. My D: drive had 2 GBs free and E: drive had 5 GBs free. My C: drive had just 57 MB free (I moved some files to D: drive, it had 0 bytes free previously.

I want to buy a new HDD coz my 160GB HDD is just too small tostore all my massive software, songs, movies collection. I’ve even burnt 30-40 dvds, still I am struggling with downloading problems.

So, after all the problems I finally decided to kick my laziness and plunge into the task of cleaning up some mess.

I uninstalled about 20-25 softwares and now, it my start menu is starting to look normal again (Previously it went out of the screen with huge list of softwares). My C: drive has 600MB free space now. Its feeling like I’ve removed a huge burden from above my head. I’ve still many softwares to go. I would love to format my computer but since it is heavily modifies and tweaked by me, I think I wouldn’t uninstall until a major problem compels me to.

Will post an update on how much I freed my hard drive and how is my computer doing now.