473,765 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with loading image in FF-Win

The statement:

myImage.src = "wiggy.jpg" ;

appears to be a no-operation in FireFox 2.0.0.14 under XP. Works fine in
IE7 (XP) and on the Mac under Safari and FF.

myImage points to an <img ...and wiggy.jpg is in the same directory as
the HTML file (a network mount, from which all these browsers were
accessing it).

I did read somewhere that JS is not supposed to have access to the local
filesystem and therefore the operation should be disallowed anyway,
however, this sort of operation seems to be widespread. See, e.g.:

http://www.webdevelopersnotes.com/tips/html/42.php3

Any pointers welcome.
Jun 27 '08 #1
6 1323
Tim Streater wrote:
The statement:

myImage.src = "wiggy.jpg" ;

appears to be a no-operation in FireFox 2.0.0.14 under XP. Works fine in
IE7 (XP) and on the Mac under Safari and FF.

myImage points to an <img ...and wiggy.jpg is in the same directory as
the HTML file (a network mount, from which all these browsers were
accessing it).
If FF on the Mac works then it is hard to tell why it does not work with
FF on Win. Have you checked with DOM inspector that the src property is
indeed changed? Have you checked the error console (just to make sure
there is no script error or security problem shown)?
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jun 27 '08 #2
In article <48************ **********@news spool2.arcor-online.net>,
Martin Honnen <ma*******@yaho o.dewrote:
Tim Streater wrote:
The statement:

myImage.src = "wiggy.jpg" ;

appears to be a no-operation in FireFox 2.0.0.14 under XP. Works fine in
IE7 (XP) and on the Mac under Safari and FF.

myImage points to an <img ...and wiggy.jpg is in the same directory as
the HTML file (a network mount, from which all these browsers were
accessing it).

If FF on the Mac works then it is hard to tell why it does not work with
FF on Win.
Quite!
Have you checked with DOM inspector that the src property is
indeed changed?
To get this I re-installed FF. My <imghas no src attribute under XP.
FF-Mac shows the expected value for this attribute.

If I give the <imgan src attribute in the source, giving some
non-existent file, then that is what show up in the DOM inspector.
Setting it to something else has no effect - the src attribute is
unaltered.
Have you checked the error console (just to make sure
there is no script error or security problem shown)?
Yes - the error console shows nothing.

Clutching at straws I requested colleagues to try it - and for them,
with FF under XP, it works. So it looks like it's limited to my PC, but
I'm damned if I can see why.
Jun 27 '08 #3
Tim Streater escribió:
The statement:

myImage.src = "wiggy.jpg" ;

appears to be a no-operation in FireFox 2.0.0.14 under XP. Works fine in
IE7 (XP) and on the Mac under Safari and FF.

myImage points to an <img ...and wiggy.jpg is in the same directory as
the HTML file (a network mount, from which all these browsers were
accessing it).

I did read somewhere that JS is not supposed to have access to the local
filesystem and therefore the operation should be disallowed anyway,
however, this sort of operation seems to be widespread. See, e.g.:

http://www.webdevelopersnotes.com/tips/html/42.php3
In a previous message you asked advice on how to insert a picture from
the client file system in a page from an Internet site. This article
talks about rollovers, which has absolutely nothing to do with it.

Firefox does allow to dynamically change the src attribute of an <img>
tag. But it won't display a client image in a server document, not even
statically:

<img src="file:///C:/Foo/tmp/paisaje01.jpg" width="100" height="100"
alt="" title="">

This works locally but not once you publish the page. If plain HTML
won't allow it, there's no point in generating that HTML with JavaScript.

I'm not sure if you can circumvent it with iframes or any other trick,
but you should first test with simple plain HTML.

BTW, "wiggy.jpg" is a relative path: it will only load the file from
your computer until you fetch it through a web server.

--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al baño María: http://www.demogracia.com
--
Jun 27 '08 #4
Tim Streater wrote:
Clutching at straws I requested colleagues to try it - and for them,
with FF under XP, it works. So it looks like it's limited to my PC, but
I'm damned if I can see why.
The is a preference dom.disable_ima ge_src_set which is probably true for
your Firefox profile. Type
about:config
into the location bar and search for that preference.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jun 27 '08 #5
In article <g1**********@h uron.algomas.or g>,
"Álvaro G. Vicario" <al************ ****@demogracia .comwrote:
Tim Streater escribió:
The statement:

myImage.src = "wiggy.jpg" ;

appears to be a no-operation in FireFox 2.0.0.14 under XP. Works fine in
IE7 (XP) and on the Mac under Safari and FF.

myImage points to an <img ...and wiggy.jpg is in the same directory as
the HTML file (a network mount, from which all these browsers were
accessing it).

I did read somewhere that JS is not supposed to have access to the local
filesystem and therefore the operation should be disallowed anyway,
however, this sort of operation seems to be widespread. See, e.g.:

http://www.webdevelopersnotes.com/tips/html/42.php3

In a previous message you asked advice on how to insert a picture from
the client file system in a page from an Internet site. This article
talks about rollovers, which has absolutely nothing to do with it.
It has a button that says "Hover over me" or words to that effect, and
the trick they wish to demonstrate (the button changing) did not work on
my PC. This was an example of my problem. Sorry - I should have made
that clearer.
Firefox does allow to dynamically change the src attribute of an <img>
tag. But it won't display a client image in a server document, not even
statically:

<img src="file:///C:/Foo/tmp/paisaje01.jpg" width="100" height="100"
alt="" title="">

This works locally but not once you publish the page. If plain HTML
won't allow it, there's no point in generating that HTML with JavaScript.
Of course, but at the moment I am researching what technique to be used
in a larger app, which already exists. I can use an <input type=fileto
ask a filename, and If I could just have a Submit button then the form's
action can process the image, no problem. But in this particular
example, I can't use a submit button, for reasons to do with the
pre-existing app.

The image will be added to a database record. In essence I am going to
have to get the it from the user's file system, hold it in a JS variable
while the user possibly makes many other changes, on other pages, and
then when the user wants to save all their changes, store it back in the
database record, which is on the server. The app, which I wrote, already
exists - I am just extending it slightly so the user can have a picture
in the record.
I'm not sure if you can circumvent it with iframes or any other trick,
but you should first test with simple plain HTML.
An iframe is what I am going to have to try.
BTW, "wiggy.jpg" is a relative path: it will only load the file from
your computer until you fetch it through a web server.
Yes - this was just an example.

Now I know that this issue seems to be limited to my own PC, I'll stop
trying to fix it (re-installing FF did not help).

Thanks for your feedback.
Jun 27 '08 #6
In article <48************ **********@news spool4.arcor-online.net>,
Martin Honnen <ma*******@yaho o.dewrote:
Tim Streater wrote:
Clutching at straws I requested colleagues to try it - and for them,
with FF under XP, it works. So it looks like it's limited to my PC, but
I'm damned if I can see why.

The is a preference dom.disable_ima ge_src_set which is probably true for
your Firefox profile. Type
about:config
into the location bar and search for that preference.
Thanks - that's really helpful. I'll look at that tomorrow at work.
Jun 27 '08 #7

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

Similar topics

2
42496
by: day | last post by:
I'm trying to use a non-scrolling background image within a div (the non-scrolling part is a "nice-to-have" vs a "have to have"). The style for that is: <div style="height=400px; background-image:url(bgrd-foo.jpg); background-position: center top; background-repeat:no-repeat; background-attachment: fixed;">
6
2238
by: Pierre-Benoit | last post by:
Hi there, I've a strange problem with ado.net and an Access db. I need to create a little C# app that take the content of "ole object" field and then save it into a file. The problem is that when I do the following Byte byteBLOBData = new Byte; byteBLOBData = (Byte)(ds.Tables.Rows);
0
1496
by: Tony Lugg | last post by:
I have an application with a document management form. When users add documents to the form, I call the API function SHGetFileInfo to get the associated large and small icons for the file. These icons are added to two ImageList objects which are bound to a ListView control, and everything looks great. I am saving the icons to a SQL Server table by using Icon.Save to a stream and assigning the byte array to the field, then loading them...
3
2758
by: Tony Lugg | last post by:
I have an application with a document management form. When users add documents to the form, I call the API function SHGetFileInfo to get the associated large and small icons for the file. These icons are added to two ImageList objects which are bound to a ListView control, and everything looks great. I am saving the icons to a SQL Server table by using Icon.Save to a stream and assigning the byte array to the field, then loading them...
9
25848
by: Jason Boardman | last post by:
Can anyone tell me how I can write HTML to a WebBrowser control in Visual Basic 6? I want to display HTML in the browser that is generated from within my VB program (as opposed to loading it from a file or URL). Is this possible? Jason
27
2278
by: Chris Tomlinson | last post by:
Hi, is there any way to specify the sequence in which images load on a web page? More specifically, here is what we need to achieve: Image1 starts loading first and the browser does not continue through the HTML until Image1 has loaded COMPLETELY. When Image1 is done, Image2 BEGINS loading. When Image2 is 100% done, only then does Image 3 begin... and so on...
4
10102
by: Heinrich Wolf | last post by:
Hi all I have a history.back() problem with FF(2). IE works as expected, while FF does not. The multi frame website setup as a whole with a lot of frame content switching works flawlessly in both browsers. In one situation and frame I have a long scrollable list of cars offered for sale. Some list lines are linked to a separate page with images, to be loaded into the same frame as the listing. On closing this image page with <a...
7
3009
by: psybert | last post by:
Hello everyone, Long time lurker, first time poster. I'm a beginner coder, and I've taught myself everything with the help and expertise of users and websites like this one. I normally figure out any problem, but this one really has me stumped. Basically, I have created a site that initially loads a set of "items" and their values into 17 drop down menus from an XML file. Each of those "items" when selected from the drop down menu loads...
4
4395
Cyberdyne
by: Cyberdyne | last post by:
Hi guys here is the problem, When I startup my DELL 600m laptop and get to the login screen and put in the password windows starts loading the profile and then hangs with the command prompt window in the background: (c:\windows\system32\userinit.exe) and the following error in the front window: 16 bit MS-DoS Subsystem c:\windows\system32\userinit.exe The NTVDM CPU has encoutered an illegal instruction. CS:0db7 IP:01b1 OP:ff ff ff ff...
1
3129
by: rirby2 | last post by:
Hi everyone, I'm currently having a rendering problem in IE7 (haven't even tried the lower IEs yet), vs. what I see in FF2. The simplified site can be found at solerasd.com . (There are more image elements that belong in the list but I've only posted 2 since it replicates the problem and minimizes the code to read. In FF, you should see a logo with two images (currently not HREF's) of the same size below it, and a copyright statement below...
0
9399
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,...
1
9957
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
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...
0
8832
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7379
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
5276
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
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
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.