Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #33574

Re: Getting local img to open window

Subject Re: Getting local img to open window
Newsgroups comp.lang.javascript
References <iIGdnXI93plCc8fEnZ2dnUU7-UvNnZ2d@westnet.com.au>
From Andrew Poulos <ap_prog@hotmail.com>
Date 2017-07-04 13:19 +1000
Message-ID <dLOdne8FDsjclMbEnZ2dnUU7-N-dnZ2d@westnet.com.au> (permalink)

Show all headers | View raw


On 4/07/2017 11:26 AM, Andrew Poulos wrote:
> A user can design a question layout (for an elearning web page) and the 
> layout can include an image - the user selects the image from their 
> local file system. There's a 'preview' button which opens a new window 
> showing the the user the layout.
> 
> I've started working with FileReader but I have some trouble getting 
> things working. I need help with:
> 
> - How can I pass the reader result to the new window?
> 
> - How can the reader result be used as a CSS background image?
> For an img I can do img.src = reader.result but for a background image 
> is it just
> div.style.backgroundImage = "url('" + reader.result + "')";
> ?

Ok, I think I've solved it. I'm now testing/trying

div.style.backgroundImage = "url('"+window.opener.reader.result+"')";


Andrew Poulos

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Getting local img to open window Andrew Poulos <ap_prog@hotmail.com> - 2017-07-04 11:26 +1000
  Re: Getting local img to open window Andrew Poulos <ap_prog@hotmail.com> - 2017-07-04 13:19 +1000
  Re: Getting local img to open window JJ <jj4public@vfemail.net> - 2017-07-04 10:21 +0700

csiph-web