Satyendra Sahani
Satyendra Sahani

Reputation: 163

Parsing JSON file and displaying in HTML

I am getting data to jquery in json form but not able to display in HTML. I don't want use jquery to display. can i access jquery variable in HTML. Please help me, if this possible.

<script type=text/javascript>
$(function() {
  $('#result').bind('input', function() {
    $.getJSON('/prescription1', {
      a: $('input[name="a"]').val()
    }, function(data) {
        console.log(data);
    });
    return false;
  });
});

Upvotes: 1

Views: 205

Answers (1)

Ema.jar
Ema.jar

Reputation: 2434

No, you can't access jquery data using HTML. HTML is a markup language, this means that you can use html for

annotating a document in a way that is syntactically distinguishable from the text.

Now, if you want to avoid jQuery there is a vanilla javascript solution for your problem but you have to use javascript.

You can read this question on Quora to understand the differences between web languages: https://www.quora.com/What-are-the-differences-between-HTML-XML-PHP-CSS-and-JavaScript-in-layman-terms

Upvotes: 1

Related Questions