If i load a json file like this in HTML
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" id="json" src="json.json"></script>
The json file looks like this and is from another domain and can't be opened by "$getJson"
{"name":"Stop","instance":"Find","quality":"port","vsm":"port1","smn":"port2","Protection":"UK","fail":"oun domain","restriction":"other domain"}
Is there any way to use the variables from the json file in a JavaScript code?
I've tried this but no luck!
<script type='text/javascript'>
$(window).load(function(){
$.getJSON("#id", function(person){
$.each(person, function(key, value)
{document.write(key+"= "+value+"<br />");
});
});
});
</script>