jim
jim

Reputation: 1

How to read the value returned by an AJAX response

Sorry for the vague title but I'm not sure how to phrase this question.

How do I get the value of a non-element? I want to send a value into a function that is not a class or id.

This is normally how I'm used to getting a value within a function but in this case, I want to send a string into the function. How is this done? Can someone please provide an example?

var url = $('#url').val();

Something along these lines:

var url = mystring.val();

Upvotes: 0

Views: 213

Answers (1)

Stefan Kendall
Stefan Kendall

Reputation: 67892

An ajax response can contain text, json, xml, or whatever other format you want, and jQuery facilitates this. How you implement the entire end-to-end communication is dependent on what you're using for server-side stuff.

Check out $.ajax.

Upvotes: 1

Related Questions