Hello world is not working properly in html with jointjs?

I am new to html and library.js. I have this code, and as soon as I saved it as html on my laptop, suppose you need to draw two connected rectangles, but nothing is displayed in the browser. I downloaded a lot of libraries and put them in the same folder where there is an html page, but nothing is displayed.

What should I do? Where can I put the libraries that I want to use in html code?

Libraries I downloaded:

  • backbone.js
  • core.js
  • geometry.js
  • joint.all.css
  • joint.all.js
  • joint.all.min.css
  • joint.all.min.js
  • joint.css
  • joint.dia.cell.js
  • joint.dia.element.js
  • joint.dia.graph.js
  • joint.dia.link.js
  • joint.dia.paper.js
  • joint.js
  • joint.min.css
  • joint.min.js
  • joint.shapes.devs .js
  • joint.shapes.devs .min.js
  • joint.shapes.erd.js
  • joint.shapes.erd.min.js
  • joint.shapes.fsa.js
  • joint.shapes.fsa.min.js
  • joint.shapes.org.js
  • joint.shapes.org.min.js
  • jquery.js
  • jquery.sortElements.js
  • lodash.js
  • raphael-min.js
  • RaphaΓ«l.js
  • vectorizer.js

    <link rel="stylesheet" type="text/css" href="joint.css" />
    <script type="text/javascript" src="joint.js" ></script>    
    <script type="text/javascript">
    
    $(function() {    
        var graph = new joint.dia.Graph;
    
        var paper = new joint.dia.Paper({
             el: $('#myholder'),
             width: 600,
             height: 200,
             model: graph
        });
    
        var rect = new joint.shapes.basic.Rect({
             position: { x: 100, y: 30 },
             size: { width: 100, height: 30 },
             attrs: { rect: { fill: 'blue' }, text: { text: 'my box', fill: 'white' } }
        });
    
        var rect2 = rect.clone();
        rect2.translate(300);
    
        var link = new joint.dia.Link({
             source: { id: rect.id },
             target: { id: rect2.id }
        });
           graph.addCells([rect, rect2, link]);
    })           
    </script>
    
    
    <div id="myholder" >
    </div>
    

.. , URL- -. , , :

<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" ></script>
<script src= "http://denknix.com/astro/lib/joint/www/build/joint.all.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.jointjs.com/downloads/joint.css" />
<script type="text/javascript" src="http://www.jointjs.com/downloads/joint.js" ></script>   
<script type="text/javascript">
    $(function() {

        var graph = new joint.dia.Graph;

        var paper = new joint.dia.Paper({
             el: $('#myholder'),
             width: 600,
             height: 200,
             model: graph
        });

        var rect = new joint.shapes.basic.Rect({
             position: { x: 100, y: 30 },
             size: { width: 100, height: 30 },
             attrs: { rect: { fill: 'blue' }, text: { text: 'my box', fill: 'white' } }
        });

        var rect2 = rect.clone();
        rect2.translate(300);

        var link = new joint.dia.Link({
             source: { id: rect.id },
             target: { id: rect2.id }
        });
graph.addCells([rect, rect2, link]);
    })     
    </script>

    <title>Test</title>

</head>
<body>

    <div id="myholder" >
    </div>

</body></html>
0
1

, :

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" ></script>
<script src= "http://denknix.com/astro/lib/joint/www/build/joint.all.min.js"></script>

, jQuery joint.js, joint.all.min.js - JointJS (0.4).

, :

<link rel="stylesheet" type="text/css" href="http://www.jointjs.com/downloads/joint.css" />
<script type="text/javascript" src="http://www.jointjs.com/downloads/joint.js" ></script>

, .

+2

Source: https://habr.com/ru/post/1527370/


All Articles