By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,943 Members | 1,890 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,943 IT Pros & Developers. It's quick & easy.

DHTML img elements -- browser compatibility

P: n/a
[if I am posting to the wrong group, apologies & please advise as to
correct one]

[sound of head-scratching]
Is there a list of which browsers allow DHTML to create new <img>
elements? e.g.
var img = document.createElement('img'); img.src = '...some image
source path...';

I've been working on a webpage which uses Javascript to add images
dynamically. Works fine on Firefox. I've been using a different browser
(Mozilla 1.7.5) to test pages to make sure the browser isn't seeing any
special permissions (being logged into websites for instance). It won't
let me modify the .src field of an image, even a new one. It appears as
though the .src field reverts to null.

I did something similar about a year ago, & could have sworn it was
working just fine last year on Moz 1.7.5...

is this bad methodology? is there a good list of what DHTML/Javascript
features that work in Firefox will break on IE / Netscape / Mozilla?

Jan 9 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Jason S wrote:
[if I am posting to the wrong group, apologies & please advise as to
correct one]
This is on-topic here.
Is there a list of which browsers allow DHTML
It is the DOM, not DHTML. Do not fall for buzzwords.
to create new <img>
elements? e.g.
var img = document.createElement('img'); img.src = '...some image
source path...';
Every UA that supports W3C DOM Level 2 HTML should support that.
I've been working on a webpage which uses Javascript to add images
dynamically. Works fine on Firefox. I've been using a different browser
(Mozilla 1.7.5) to test pages to make sure the browser isn't seeing any
special permissions (being logged into websites for instance). It won't
let me modify the .src field of an image, even a new one. It appears as
though the .src field reverts to null.
Impossible to say without snippets of source code/URL. But so far,

<URL:http://pointedears.de/ObjInsp>

has worked with all Mozilla/5.0 versions up to 1.8.
[...]
is this bad methodology?


I do not think so, but it depends on its application.
PointedEars
Jan 9 '06 #2

P: n/a
> I've been working on a webpage which uses Javascript to add images
dynamically. Works fine on Firefox. I've been using a different browser
(Mozilla 1.7.5) to test pages to make sure the browser isn't seeing any
special permissions (being logged into websites for instance). It won't
let me modify the .src field of an image, even a new one. It appears as
though the .src field reverts to null.


Hmm, I wasn't sure if this message had got posted. (I read it via
google groups & it looked like it hadn't been posted)

I realized the next day that I had Mozilla 1.7.5's security settings to
disallow webpages from changing images.
<sheepish look>

thanks for the response though...

Jan 12 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.