Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Post values with page refresh without using <form>?

Tags:

html

jquery

ajax

With JQuery I can easily do an AJAX post of key value pairs without a form and without a page refresh:

$.ajax({ type: 'POST', url: url,  data: { key: value, key: value, etc...}  });

But is there a way to post a set of non-form data values with a page refresh, or do I need to take the conventional route of setting up a set of form elements, loading their values, and then submitting the form?

thanks!

like image 240
user682971 Avatar asked Apr 11 '26 02:04

user682971


1 Answers

You could go the conventional route, but have jQuery build and populate a form dynamically if you wanted to avoid putting a <form> on the page.

like image 186
Jacob Avatar answered Apr 13 '26 15:04

Jacob