DHTML img elements -- browser compatibility

J

Jason S

[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?
 
T

Thomas 'PointedEars' Lahn

Jason said:
[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
 
J

Jason S

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top