Kitware / paraviewweb

Web framework for building interactive visualization relying on VTK or ParaView to produce visualization data
http://kitware.github.io/paraviewweb/
BSD 3-Clause "New" or "Revised" License
163 stars 51 forks source link

Cannot read property 'style' of null #159

Closed jbeezley closed 8 years ago

jbeezley commented 8 years ago

The following html results in the error Cannot read property 'style' of null when loading:

<!DOCTYPE html>
<html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset = UTF-8">
  <script type="text/javascript" src="ParaViewWeb.js"></script>
</head>

<body>
</body>

</html>

It seems to be originating from this line: src/InfoViz/Native/HistogramSelector/index.js#L42. It does load successfully if I move the script tag into the body.

aronhelser commented 8 years ago

Makes sense that it would cause an error - there's no 'body' yet. I'll see if I can just substitute 'head'...

jourdain commented 8 years ago

ParaViewWeb script might need to be inside body. Not sure why though.

On Thu, Jul 7, 2016 at 10:28 AM, aronhelser notifications@github.com wrote:

Makes sense that it would cause an error - there's no 'body' yet. I'll see if I can just substitute 'head'...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Kitware/paraviewweb/issues/159#issuecomment-231094449, or mute the thread https://github.com/notifications/unsubscribe/AAR-doQccUjZ5OlEwAO6_uvPfpbJB73Fks5qTQ0OgaJpZM4JHIOz .

aronhelser commented 8 years ago

Using document.head.style seems to be working fine. Should go in with next HistogramSelector features.

jbeezley commented 8 years ago

This is admittedly pathological, but does it still work if there is no head? Is there any reason executing this function can't be deferred until a HistogramSelector is actually instantiated?

aronhelser commented 8 years ago

OK, I can defer it. I also used either head or body, with a fallback. Thanks for the feedback.

On Fri, Jul 8, 2016 at 1:07 PM, Jonathan Beezley notifications@github.com wrote:

This is admittedly pathological, but does it still work if there is no head? Is there any reason executing this function can't be deferred until a HistogramSelector is actually instantiated?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Kitware/paraviewweb/issues/159#issuecomment-231416291, or mute the thread https://github.com/notifications/unsubscribe/AS_pnc3SNqk5pkdnIk4PV5pT0w3-WOYuks5qToPsgaJpZM4JHIOz .