Hi i have a simple question. I want to know how to pass a query string into a query parameter using jquery.
function loadPage(queryString) {
jQuery("#divId").load("myurl/action?param=" + queryString);
}
queryString could be like "1,2,3,4" or "testing 1 2 3".
When I tried it only the first parameter is their. I want to be able to pass in a sentence, or a paragraph.
try
function loadPage(queryString) {
jQuery("#divId").load("myurl/action?param=" + encodeURIComponent(queryString));
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With