开发者

jQuery: how do I append variables onto a form path?

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&amp;CKEditorFuncNum=1&amp;langCode=en">
 </form>


Like this:

$('#myform').attr('action', $('#myform').attr('action') + '&var=value');

More Info:

  • http://api.jquery.com/attr/
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜