473,748 Members | 2,625 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

JavaScript image loading problem in Firefox

Firefox seems to be restricting JavaScript image loading. The following
code works fine in all browsers except Firefox:

function loadImage()
{
var objIcon = document.create Element( 'IMG' );
objIcon.src = "/techJournal/firefoxIcon.png ";
document.body.a ppendChild( objIcon );
}

The image simply doesn't load, as you will see at:
http://www.firethefox.co.uk/techJour...avaScript.html

Could it be that the security lockdowns in the latest version of
Firefox prevent image loading in JavaScript? If so, does anyone know a
workaround that I can introduce into my code?

I'd be grateful for your help

Chris Beach

Dec 19 '05 #1
7 7661
ch***@chrisbeac h.co.uk wrote in news:1135005379 .885527.267190
@g43g2000cwa.go oglegroups.com:

The image simply doesn't load, as you will see at:
http://www.firethefox.co.uk/techJour...avaScript.html


does this mean you fixed it? works fine in FF1.5 for me.
Dec 19 '05 #2
Nope, unfortunately not. Maybe this only fails with certain
environments?

Dec 19 '05 #3
Images are enabled in my browser, and the problem occurs whether or not
the "for the originating site only" option is ticked.

Any more ideas, anyone?

Dec 19 '05 #4
Yes, JavaScript is enabled, and there are no messages in the JavaScript
console.

Dec 19 '05 #5
ch***@chrisbeac h.co.uk wrote:
Firefox seems to be restricting JavaScript image loading. The following
code works fine in all browsers except Firefox:

function loadImage()
{
var objIcon = document.create Element( 'IMG' );
objIcon.src = "/techJournal/firefoxIcon.png ";
document.body.a ppendChild( objIcon );
}
<URL:http://PointedEars.de/scripts/test/whatami#inferen ce>
The image simply doesn't load, as you will see at:
http://www.firethefox.co.uk/techJour...avaScript.html
WFM. Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051217
Debian/1.5.dfsg-2 Firefox/1.5 Mnenhy/0.7.3.0
Could it be that the security lockdowns in the latest version of
Firefox prevent image loading in JavaScript?
Check Edit, Preferences, Content, Load Images.
Try Ctrl+Shift+r. Clear the cache (directory).
If so, does anyone know a workaround that I can introduce into my code?


Fortunately for other users, there is none.
PointedEars
Dec 19 '05 #6
My UA is Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8)
Gecko/20051111 Firefox/1.5

I have tried the steps you pointed out but to no avail

My employer puts restrictions and enforced configuration on certain
software. It could be that these apply to Firefox and are causing the
problem I'm seeing. Thanks for looking into this, guys. I guess the
issue isn't widespread so I probably shouldn't be worried about it.

Dec 20 '05 #7
The problem has been identified by Ben Basson, who commented on my
blog:

Having the pref "dom.disable_im age_src_set" set as the boolean value
'true' in about:config will cause your script to fail.

IIRC, this option was removed from the interface because there's no
logical reason that anyone would want to disable this behaviour. It's
default value is set to 'false', i.e. changing the src of an image is
allowed by default.

I can't think of a workaround, but I sort of hope that there isn't one,
since that would somewhat devalue the preference.

Dec 22 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
5210
by: joaopedrogoncalves | last post by:
Hi, I want to load an external javascript file, get its results and stick them inside a <div> block. I also want to do this in several places on a web page. This way the browser doesn't have to wait for the external resource to load to show up the page, thus giving a perceiving faster load time for the user.
4
44087
by: zborisau | last post by:
Hey good people, I've been given a problem to solve recently - and stuck with the solution for a good 4 days already. i have a link which leads to popup window. the purpose of that popup window is to redirect user to the one of available servers. so i need to check which server is available. i have decided to download some 1pixel image from every server and if it was downloaded
3
2659
by: willwade | last post by:
Hi there, Sorry for the perhaps undirected post - Ive struggled for the past few hours and cant see the wood for the trees.. I have a page (infact a site but I will keep it simple) that is a css/table mix. One of the images is sitting in a pretty straightforward div: <td valign="top" width="391" align="left"> <div id="bigimage"><img
3
2095
by: jblossom | last post by:
Hello, I'm in a quandary as to how to address a problem. The site in question: http://agapeyoga.com On the left-hand side of the site are image navigation elements that change when clicked based on where you are in the navigation heirarchy. They work just fine in IE, but Firefox doesn't load the initial state of the images. If you mouse over the images that have onmouseover or
8
3674
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
3
6693
by: Joe Cox | last post by:
I am having a problem with style properties for dynamic images in Mac OS X Safari. By dymanic images, I mean images allocated with the javascript 'new Image()' call. With static images (created with the html <img> tag), I can make the image visible or not, i.e. '<img style="visibility='hidden'" src='xxxx'/>'. But if I create the image dynamically with javascript: new Image() then try to modify the style, Safari chokes, and the Debug...
1
3811
by: ozzy.osborn | last post by:
Hello All, I have been struggling with a cross browser solution to loading external javascript files on the fly. I have been successful using the following code in IE6: var newScr = document.createElement("SCRIPT"); newScr.src = "newScr.js"; newScr.type="text/javascript";
12
2613
by: tim | last post by:
I am using foldoutmenu 3 and am having problems with viewing my menus in firefox. On my sub3 menus i have more than one line of text in some places. firefox does not recognise that there is more than one line and the text simply overlaps the sub-menus below it. I thought i had got around this by placing empty 'spacers' like so; oFoldMenu.make('sub3','')//spacer unfortunately, i have just viewed the site in IExplorer and it has added...
2
3573
by: OBAFGKM_RNS | last post by:
Let's say I have a Javascript function that loops over and over. In that function i have it alternating images on a button this way: if(var==0){ var myHTML = "<input type='button' style='background-image: url(grnbutt.jpg);etc. etc.'>"; var outq = document.getElementById("qbutt"); outq.innerHTML = myHTML; } else{
0
8995
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9381
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.