/    Sign up×
Community /Pin to ProfileBookmark

It works in IE but it doesn’t work in Opera and Netscape

Hi,
I want to open a window ‘Untitled-1.htm’ and I want to change an image in ‘Untitled-1.htm’
It works in IE but it doesn’t work in Opera and Netscape

myWindow = open(‘Untitled-1.htm’);
myImage=new Image();

myImage.src= (“1.jpg”) ;
myWindow.document.images[0].src= myImage.src;

Can anybody tell me, how can I use it in Opera and in Netscape?
Many Thanks

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceMay 20.2006 — Does that url actually exist for the [B]open()[/B] method to find? ...or, are you trying to open a blank window?
Copy linkTweet thisAlerts:
@Pawlik_KrasnodaauthorMay 20.2006 — >Does that url actually exist for the open() method to find?

Yes, it does

all browsers can it open

but only Internet Explorer changes an image
Copy linkTweet thisAlerts:
@phpnoviceMay 20.2006 — Which is it doing -- opening in the current window? ...or, opening a separate window?
Copy linkTweet thisAlerts:
@Pawlik_KrasnodaauthorMay 20.2006 — the current window (Index.htm) is it doing

Index.htm:

<head>

<title>index</title>

<script type="text/javascript">

<!--

function imageChange()

{

myWindow = open('Untitled-1.htm');

myImage=new Image();

myImage.src= ("1.jpg") ;

myWindow.document.images[0].src= myImage.src;

}

//-->


</script>


</head>

<body>

<a href="javascript:imageChange()">image</a></body>

</html>

Untitled-1.htm

<body>

<p><img src="0.jpg"></p>

</body>
Copy linkTweet thisAlerts:
@phpnoviceMay 20.2006 — If you can provide a live link to your page on the Internet, then I can test your image process myself.
Copy linkTweet thisAlerts:
@Pawlik_KrasnodaauthorMay 21.2006 — Now, it works. But I don&#8217;t know why. :-)

Thanks :-)
Copy linkTweet thisAlerts:
@phpnoviceMay 21.2006 — That's cool.

Cheers.
×

Success!

Help @Pawlik_Krasnoda spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...