Lets say the URL in开发者_StackOverflow社区 my form is
action="/medias/new_from_disk?CKEditor=content_body&CKEditorFuncNum=1&langCode=en"
and the form has ID myform
how would I conjure a jQuery command to add to the action
&var=value
?
complete form:
<form enctype="multipart/form-data"
id="myform"
method="POST"
action="/medias/new_from_disk?CKEditor=content_body&CKEditorFuncNum=1&langCode=en">
</form>
Like this:
$('#myform').attr('action', $('#myform').attr('action') + '&var=value');
More Info:
- http://api.jquery.com/attr/
精彩评论