0

I want d3 to work badly. I have this JFXPanel which displays a html page, which references d3.js. It is almost a duplicate of my other question but have not received much response - How to determine if i have implemented d3 correctly?

Went to research on JavaFX, WampServer, D3.js (all due to recommendations) on top of much troubleshooting but still no avail. All I need is the HTML page to display some visual elements & im all set to proceed further. Can someone pls tell me why i cannot reference any d3 elements with the following, after every period? The website run on WampServer does not display as expected as well.

  • jfxpanel in a swing project, eclipse, where jfxpanel runs html page.
  • html page and d3.js are in the same folder.
  • i can see the source of 'd3.js' when i 'inspect element' @ the html page.
  • i will not see the source if i set the src to 'd3.v3.js'
  • html elements (not within js) are working properly though.

Code:

<!DOCTYPE html>
<html lang = "en">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <meta content="utf-8" http-equiv="encoding">  
        <title>D3 test</title>
        <script type = "text / javascript" src= "d3.js"></script>
    </head>

    <body>  
        <p></p>
        <script type = "text / javascript">
            d3.select("body").append("p").text("Hello, world!");            
        </script>       
    </body>
</html>
Community
  • 1
  • 1
miiike test
  • 103
  • 6
  • possible duplicate of [How to determine if i have implemented d3 correctly?](http://stackoverflow.com/questions/28461938/how-to-determine-if-i-have-implemented-d3-correctly) – Mark Feb 13 '15 at 17:24
  • Hi thank you i understand it was a duplicate. Sorry. I just posted my answer & resolved it. It was really dumb of me to have made such a mistake. – miiike test Feb 13 '15 at 17:26

1 Answers1

0

OH MY GOD. Never expected it to be such a simple mistake that took up 3 days of troubleshooting. Im sorry but perhaps this may help some others in future. Everything went well after that. Totally caught me off-guard.

Do not include spaces @ the following line:

<script type = "text / javascript" ...>

It should read:

<script type = "text/javascript" ...>
miiike test
  • 103
  • 6