2016-09-01 47 views
0

我想知道爲什麼在保存TinyMCE:s編輯器中的內容時,我總是收到錯誤「HTTP錯誤405.0 - 方法不允許 您正在查找的頁面無法顯示,因爲無效方法(HTTP動詞)正在使用。「這裏是我的代碼:在TinyMCE中保存內容時發生HTTP錯誤405.0

HTML:

<form method="get"> 
       <textarea id="mytextarea">This is an implementation of TinyMCE in an Angular application.</textarea> 
       <button name="submitbtn"></button> 
      </form> 

的JavaScript:

tinymce.init({ 
     selector: '#mytextarea', 
     plugins: [ 
      "advlist autolink lists link image charmap print preview anchor",  // tillägg av plugins line fick 
      "searchreplace visualblocks code fullscreen",       // Insert, Table och Tools menyer att dyka upp 
      "insertdatetime media table contextmenu paste", 
      "save", /*HTTP Error 405.0 - Method Not Allowed 
The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.*/ 

      //'codemirror' 
     ], 
     toolbar: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | code | save' 
    }); 

提前感謝!

此致阿提拉

+0

將您得到提交您的形式? – InferOn

回答

0

雖然表單可以使用GET方法提交,表單應該(一般來說),使用HTTP POST提交(未GET)。例如:

<form method="post" action="URLToSendFileTo.php"> 
... 
</form> 

(提交使用GET具有的內容量的限制,你可以提交和形式的內容成爲URL的一部分,它可以在許多情況下是不希望的)

當使用形式標籤,您需要提供action屬性,以便頁面知道應該在哪裏發佈信息。

本頁提供有關的<form>標籤及其選項的詳細信息:http://www.w3schools.com/tags/att_form_method.asp

作爲一個側面說明...有5個,你可能需要在開發中使用基本的HTTP動詞。怎麼每次都普遍使用的簡要概述可以在這裏找到:

http://www.restapitutorial.com/lessons/httpmethods.html

相關問題