This is a universal way to create GET requests using jQuery:
var loadUrl="mypage.php"; $("#get").click(function(){ $("#result").html(ajax_load); $.get( loadUrl, {language: "php", version: 5}, function(responseText){ $("#result").html(responseText); }, "html" ); });
I was wondering if I can pass parameters (Ex.language and version) directly to Url (after urlencoding them):
var loadUrl="mypage.php?language=php&version=5"; $("#get").click(function(){ $("#result").html(ajax_load); $.get( loadUrl, function(responseText){ $("#result").html(responseText); }, "html" ); });
Is it possible? And anyway, this is the cleanest solution for calling ajax if I have all the parameters I need urlencoded (Ex.rate me)
luca
source share