Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
古いリリースのバグを修正するために、ページ内のすべての動的リンクにクエリ文字列を追加したいのですが、これは可能ですか?
何か案は?
このようなもの?
var querystring = 'myquerystringtoadd'; $('a').each(function() { var href = $(this).attr('href'); if (href) { href += (href.match(/\?/) ? '&' : '?') + querystring; $(this).attr('href', href); } });
作業例。