Add the second attribute you want to match against separated by comma:
$(document).ready(function(){
$("body a[href^='http'],[href^='ftp']").attr("target","_blank");
});
Example: jsFiddle
Question
I have the following script that adds target="_blank" to all "http" and "https" links:
$(document).ready(function(){
$("body a[href^='http']").attr("target","_blank");
});
Example: JSFIDDLE
How to add to this script the "ftp" links?
Solution
Add the second attribute you want to match against separated by comma:
$(document).ready(function(){
$("body a[href^='http'],[href^='ftp']").attr("target","_blank");
});
Example: jsFiddle