I've started a new Java EE project which has to use jointjs library. However, I'm using primefaces framework. I've put the hello world in my index.xhtml (blue font)
<f:view contentType="text/html">
<h:head>
<f:facet name="first">
<meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
<link rel="stylesheet" type="text/css" media="screen" href="css/joint.min.css" />
<script type="text/javascript" src="js/jquery.js" />
<script type="text/javascript" src="js/joint.nojquery.min.js" />
<!--<script type="text/javascript">jQuery.noConflict();</script>-->
</f:facet>
</h:head>
<h:body>
<p:layout fullPage="true">
<p:layoutUnit position="north" size="100" resizable="true" closable="true" collapsible="true">
<p:graphicImage value="/images/banner.jpg" height="100"/>
</p:layoutUnit>
<p:layoutUnit position="south" closable="true" collapsible="true">
<!--<p:clock pattern="HH:mm:ss dd.MM.yyyy" mode="server" />-->
<h:form>
<h:link value="Retour à l'accueil" outcome="index.xhtml" />
</h:form>
</p:layoutUnit>
<p:layoutUnit position="west" size="180" header="Liste des SI" >
<ui:include src="/menu.xhtml" />
</p:layoutUnit>
<p:layoutUnit position="center">
<h2 align="center" style="color: #f6a828;border:1px solid #f6a828;">
</h2>
<p:tabView styleClass="ui-tabs-bottom" >
<p:tab title="Carte" titletip="Présentation des interactions entre les éléments du SI">
<div id="map">
</div>
</p:tab>
<p:tab id="state" title="Etat" titletip="Etats des éléments du SI">
Etat 1
</p:tab>
<p:tab id="reporting" title="Rapports" titletip="Rapports de supervision pour le SI">
Rapports 1
</p:tab>
</p:tabView>
</p:layoutUnit>
</p:layout>
<script type="text/javascript">
var graph = new joint.dia.Graph;
var paper = new joint.dia.Paper({
el: $('#map'),
width: 500,
height: 500,
model: graph
});
var rect = new joint.shapes.basic.Rect({
position: { x: 100, y: 30 },
size: { width: 100, height: 30 },
attrs: { rect: { fill: 'orange' }, text: { text: 'my box', fill: 'white' } }
});
var rect2 = new joint.shapes.basic.Rect({
position: { x: 100, y: 30 },
size: { width: 100, height: 30 },
attrs: { rect: { fill: 'orange' }, text: { text: 'my box2', fill: 'white' } }
});
rect2.translate(90);
var link = new joint.dia.Link({
});
graph.addCells([rect, rect2, link]);
</script>
</h:body>
</f:view>
</html>
I got the following error in javascript console.
I'm beginner in js, don't know what to do. Can anyone help me?