2013-07-12 51 views
0

我使用JQuery AJAX。我需要發送一些數據頁,比接收數據,去除所有標籤(包括HTML),並設定新的一頁是這樣的:更改所有的html代碼

<html> 
<head></head> 
<body>Example</body> 
</head> 

我使用這個jQuery腳本:

$.ajax({ 
    type: "POST", 
    url: "some.php", 
    data: "name=John", 
    success: function(msg){ 
    //how remove and set new page? 
    } 
}); 
+4

爲什麼不簡單地重定向到新的頁面? –

+4

這聽起來像一個可怕的想法相比,一個普通的回發,這幾乎完全相同的事情。 –

+0

請原諒我,但是如果您想要移除與html標籤一樣多的內容,這會有什麼意義?這只是簡單地加載一個新的頁面有什麼不同? – Trogvar

回答

1
$.ajax({ 
    type: "POST", 
    url: "some.php", 
    data: "name=John", 
    success: function(msg){ 
    window.location = 'your/new/page/url'; 
    } 
}); 
相關問題