I need to make a json request with the url structure like : site.com/page?id=123
How do I pass the variable through the request and then return the results to the page?
<input type='text' id='theInput'>
<input onclick='getIt(); return false;' />
<div id="results"></div>
<script>
function getIt(){
var x = ($j('#theInput').val() );
$j.getJSON("http://site.com/page?id=",
{
//how do i append x to request?
},
);
}
</script>
http://site.com/pageyour site or a third party site? If the latter you will run into same-origin-policy issues.