I've seen many examples of one or the other, but none with this specific set up. I have a location object currently in my URL that opens a form via jquery: http://blah.com/contact.cfm?show_sales
$(document).ready(function(){
if (window.location.search == "?show_sales") {
$('#sales_form').show();
};
I would also like a parameter to be in the URL: http://blah.com/contact.cfm?item=4445555
I've tried combinations of the two, but I don't know the proper syntax to include both. Everything I've tried won't activate the jquery.
So, what's the proper syntax for this URL?
http://blah.com/contact.cfm?show_sales&item=4445555
(this is an example of one that does not work)
http://blah.com/contact.cfm?show_sales&item=4445555is correct for adding multiple key/value pairs to a querystring. Your JavaScript just isn’t parsing that properly. Remove the leading?fromlocation.search, then split it on&.location.searchor use aRegExpto isolate query string fields and values