How to externalize json-ld and include in html doc -


is possible externalize json-ld , include in html document this:

<script type="text/javascript" src="http://www.example.com/data123.jsonld"></script> 

there doesn't seem documentation online....

you can't that. should json ajax request.

you can easy jquery

js

$(function(){   $.getjson("data123.jsonld", function(data) {       $('.json').text(data);      }); }); 

html

 <div class="json"></div> 

if json file not in file system (cross domain) should try this.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -