ChromeではこれはHTTP PUTと同じように動作しますが、FireFox 21では動作しません。 JavaScriptコンソールまたはバックエンドにエラーはありません。 jQueryのこのjQuery AJAX PUTはChromeでは動作しますが、FFでは動作しません
<div id="createTeamModal" class="small reveal-modal">
<form id="createTeamForm">
<div class="row"><p id="teamFlavorText" class="lead">Building a new team</p></div>
<div class="row">
<div class="small-4 large-4 columns"><label>Team Name:</label></div>
<div class="small-6 large-6 columns"><input name="teamName" id="teamName" type="text" size="20"/></div>
</div>
<div class="row"><p class="lead">Does this team work for a business?</p></div>
<div class="row">
<div class="small-4 large-4 columns"><label>Business Size:</label></div>
<div class="small-6 large-6 columns">
<select id="businessSizeSelect" name="businessSizeSelect">
<option value="1">Nope, I work alone</option><option value="2">2 to 49</option><option value="3">50 to 99</option><option value="4">100 to 999</option><option value="5">1,000+</option>
</select>
</div>
</div>
<div id="businessLocationDiv" class="row" style="display: none; margin-top: 20px;">
<div class="small-4 large-4 columns"><label>Business Location:</label></div>
<div class="small-6 large-6 columns">
<select id="businessLocationSelect" name="businessLocationSelect">
</select>
</div>
</div>
<div id="businessTypeDiv" class="row" style="display: none; margin-top: 20px;">
<div class="small-4 large-4 columns"><label>Industry:</label></div>
<div class="small-6 large-6 columns">
<select id="businessTypeSelect" name="businessTypeSelect">
</select>
</div>
</div>
<div class="row" style="margin-top: 20px;">
<div class="large-offset-10 small-1 large-1 columns">
<button id="createTeamButton" class="small button">Create</button>
</div>
</div>
</form>
<a class="close-reveal-modal">×</a>
</div>
そしてここにある:ここで
はHTMLである私はバイオリンでそれらを観察し、かついる$("#createTeamButton").click(function() {
var teamObject = new Team();
teamObject.description = $("#teamName").val();
teamObject.businessSize = $("#businessSizeSelect").val();
teamObject.businessType = $("#businessTypeSelect").val();
teamObject.businessLocation = $("#businessLocationSelect").val();
$.ajax({
type: "PUT",
url: "/ajax/rest/team",
dataType: "json",
data: JSON.stringify(teamObject),
success: function() {
// Reload the team select box
loadTeamSelectBox();
// Pop up the site create modal
$('#createSiteModal').foundation('reveal', 'open');
},
error: ajaxErrorHandler
});
});
作業(クローム)を作業していないとの差(Firefoxの) HTTP PUTはChromeで起動し、Firefoxでは起動しません。
今、jQuery.ajax PUTがすべてのブラウザで保証されているわけではありません。
私は、これらのサイトは、PUTは、すべてのブラウザでは動作しないかもしれませんが、FFで動作する必要があることを再確認
- Are the PUT, DELETE, HEAD, etc methods available in most web browsers?
- http://annevankesteren.nl/2007/10/http-method-support
を読みました。
最後に、私は
の作品FF21とPUTで次を打つ私は確かにこの問題を回避エンジニアことができますが、動作するはずです私には思えます。私はむしろjerry-rigを使ってはいけませんが、むしろjQueryの.ajaxが正しく動作するようにします。
その他の詳細: * jQueryのバージョン2.0.0 *バックエンドがSpring3
[HTMLを追加するための編集]
私はそれがすべてのブラウザでサポートされるとは思わない。いくつかのリンクはここに似ていますhttp://stackoverflow.com/questions/5846741/jquery-put-ajax-request-not-working http://stackoverflow.com/questions/5894400/does-jquery-ajax-work-in-現代的なブラウザ - 入れて削除する – Sakthivel
あなたのバックエンドは何ですか? – Sagish
これがjQueryのバグだと思う場合は、使用しているjQueryの正確なバージョンを提供する必要があります。しかし、私はURLが変わるので、 'PUT'とは何の関係もないと思います。 – Esailija