當我試圖逃跑通過AJAX加載與下面的內容腳本標籤:逃生腳本標記使用jQuery AJAX
$.ajax({
cache: false,
type: 'GET',
url: 'index.html',
success: function(response) {
$(response).find('<script').replaceWith('\x3Cscript');
$(response).find('</script>').replaceWith('\x3C/script>');
但是它給出了令牌是非法的錯誤...
我該如何解決這個問題?
仍然收到錯誤:'Uncaught SyntaxError:U非法的令牌ILLEGAL' – Cameron
@Cameron哪一行是拋出錯誤?你能夠在小提琴中重現這一點嗎? – agconti
第二個'$(response).find('').replaceWith('<\/script>');'你可以在這裏看到錯誤:http://preview.na-software.co.uk/Demo/MarsPlaybook/ preview.html – Cameron