Created
January 16, 2009 16:24
-
-
Save ihower/47985 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$(document).ready(function() { | |
$('#bd').click(function(event) { | |
var target = $(event.target); | |
if (target.attr('rel') == 'external') { | |
if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return true; | |
else { | |
var oWin = window.open(target.attr('href'), '_blank'); | |
if (oWin) { | |
if (oWin.focus) oWin.focus(); | |
return false; | |
} | |
oWin = null; | |
// return true; | |
} | |
} | |
// return true; | |
}); | |
}); | |
})(jQuery); | |
<a href="/foobar" onclick="var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;var s = document.createElement('input'); s.setAttribute('type', 'hidden'); s.setAttribute('name', 'authenticity_token'); s.setAttribute('value', '6f8fdqweqwea'); f.appendChild(s);f.submit();return false;" title="發佈活動"><img alt="Lightbulb" src="http://cdn.registrano.com/images/silk/lightbulb.png?1231141140">發佈活動</a> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment