You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I am "dynamically" creating a flow chart through PHP. I'm looping through a JSON object and then this is the input for ajax in JS. However when the flowchart is created I get a parse error and I don't know why.
$.ajax({type: "POST",url: "templates/experiment-parameters/equipment-diagram-mermaid.php",data: {current_selection: completeJsonObject},success: function(data){varneedsUniqueId="render"+(Math.floor(Math.random()*10000)).toString();//should be 10K attempts before repeat user finger stops working before then hopefullymermaid.mermaidAPI.render(needsUniqueId,data,mermaidApiRenderCallback);functionmermaidApiRenderCallback(graph){$('#id_equipment_diagram').html(graph);}}});
Uncaught Error: Parse error on line 1:
^
Expecting 'NEWLINE', 'SPACE', 'GRAPH', got 'EOF'
at Parser.parseError (mermaid.js:65625)
at Parser.parse (mermaid.js:65716)
at Object.getClasses (mermaid.js:65014)
at Object.render (mermaid.js:71583)
at _loop (mermaid.js:71068)
at Object.init (mermaid.js:71078)
at contentLoaded (mermaid.js:71113)
at mermaid.js:71131
The text was updated successfully, but these errors were encountered:
So I am "dynamically" creating a flow chart through PHP. I'm looping through a JSON object and then this is the input for ajax in JS. However when the flowchart is created I get a parse error and I don't know why.
Below is a summary of what I'm doing.
PHP
JS (Used the example in here)
What the PHP creates
And the output is correct -
And the error -
The text was updated successfully, but these errors were encountered: