Friday, October 28, 2011

HTML image Tag and Firefox are now friends

I have seen a lot of these questions on the web
  • Images not being displayed in Firefox
  • Images on local folders are not loading in Firefox
  • Image tags <img> don't work on Firefox
  • Images from local folders are displaying on IE and Chrome but not on Firefox and Safari
  • Firebug error: Failed to load given URL (usually an image)
I too ran into this while building a webpage. I had this simple code in my HTML file but the image won't load.

<div id="logo">
<img src="C:\xampp\htdocs\HelloNB\images\templatecompanylogo.gif" />
</div>

Why images don't load?

Due to security reasons Firefox prevents images from loading on your webpage. This restriction is on images stored in the local folder and most developers have faced this issue.

How did I solve this issue?

First off, I hit the Google road. Found a couple of suggestions from couple of people. Well, I took those few simple steps and was convinced that I was heading towards the solution. It took these for the images to appear.

I defined the source (src) property of the image (<img>) element as src="file:\\c:\< path-to-your-image-file >". (Notice the file:\\)

Like, the above code was altered and re-written as

<div id="logo">
<img src="file:\\C:\xampp\htdocs\HelloNB\images\templatecompanylogo.gif" />
</div>

For many out there, this would be it. This would work. If it doesn't, I really don't have to instruct you your next move :)

Install NoScript extension for Firefox. Navigate to Tools > Add-ons > Extensions > NoScript > Options > Advanced > Trusted > Check "Allow Local Links"

The images must now appear on your page. In case they still don't appear ................. :)

Right-click the image (un-displayed image) on your webpage, select NoScript and select "Allow http://localhost".

This worked for me and I hope this has helped you as well. If however, you had another workaround to this issue, please leave a comment or a link to the website that sourced you and thank you for doing that.

Wednesday, October 19, 2011

Running Joomla for the first time

You're almost done with the configuration and as excited about running Joomla as I was and then you see -
"Strict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\joomla16\administrator\components\com_hikashop\views\menu\view.html.php on line 15

Strict Standards: Creating default object from empty value in C:\xampp\htdocs\joomla16\administrator\components\com_hikashop\views\menu\view.html.php on line 22

Strict Standards: Non-static method hikashop::completeLink() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\joomla16\administrator\components\com_hikashop\views\menu\view.html.php on line 24

Strict Standards: Creating default object from empty value in C:\xampp\htdocs\joomla16\administrator\components\com_hikashop\views\menu\view.html.php on line 26

Strict Standards: Non-static method hikashop::completeLink() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\joomla16\administrator\components\com_hikashop\views\menu\view.html.php on line 28............................................................
You immediately Google and you reach here; or may be not, you found a link to this page. :)
Well here's what you do next.
  1. Open file php.ini (C:\xampp\php\php.ini). I hope you know your location path? Or find out.
  2. Search for term error_reporting = replace it with error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED
  3. Search term display_errors = On and replace it with display_errors = Off
  4. Stop XAMPP and restart it
  5. Run Joomla in your browser. Congratulations!

Info on phpinfo()

phpinfo() is a function (so it looks like :) which returns information about your PHP environment.

Create and save and run it. Here you go.

  1. Open your text editor (notepad application)
  2. Write this piece of code  and save the file. Say you named it (phpinfo.php)
  3. Upload the file on to your web content folder of your domain. (htdocs, if localhost)
  4. Open your browser and type in www.domainname.com/phpinfo.php (if it's on your domain) or localhost/phpinfo.php (if it's on your local disk)