0
我創建聚合物元素(w/core-ajax)發佈數據到php文件。我得到了這個錯誤,似乎數據不能發送到PHP文件。聚合物核心 - AJAX:PHP沒有找到
這個錯誤與我的服務器有關嗎?我使用yeoman +聚合物發生器來設置我的項目。 這是我的錯誤: 「無法發佈/elements/register-el/register.php」 http://s1.postimg.org/4c7dmgs1r/ask1.png
寄存器el.html
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/core-ajax/core-ajax.html">
<polymer-element name="register-el" attributes="">
<template>
<link rel="stylesheet" href="register-el.css">
<div class="body-reg">
<paper-input-decorator class="custom" label="First Name" floatingLabel autoValidate error="Firstname is required!">
<input is="core-input" type="text" value="{{fname}}" id="fname" required>
</paper-input-decorator>
<paper-input-decorator class="custom"label="Last Name" floatingLabel autoValidate error="Lastname is required!">
<input is="core-input" type="text" value="{{lname}}" id="lname" required>
</paper-input-decorator>
<paper-input-decorator class="custom" label="Email" floatingLabel error="Email is required!" autoValidate>
<input is="core-input" required type="email" id="email" value="{{email}}">
</paper-input-decorator>
<paper-input-decorator class="custom" label="Password" floatingLabel error="Must contain 8 or more characters that are of at least one number, and one uppercase and lowercase letter" autoValidate>
<input is="core-input" value="{{pwd}}" id="password" type="password" name="pwd1" required pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}">
</paper-input-decorator>
<paper-input-decorator class="custom" label="Re-type Password" floatingLabel error="input is required!" autoValidate>
<input is="core-input" value="{{cpwd}}" id="confirm_password" type="password" required pattern="{{pwd}}">
</paper-input-decorator>
<paper-button raised on-click="{{submit}}">
<core-icon icon="done"></core-icon>
Register
</paper-button>
<paper-toast id="donereg" text="Your have been registered!Go to login page">
<div style="color: #E9E88B" on-click="{{gotologin}}" id="gotolog">LOGIN</div>
</paper-toast>
<core-ajax
id="ajaxsubmit"
url="elements/register-el/register.php"
method='POST'
headers='{"X-Requested-With": "XMLHttpRequest"}'
params='{"firstname":"{{fname}}","lastname":"{{lname}}","email":"{{email}}","password":"{{cpwd}}"}'
response="{{response}}"></core-ajax>
</div>
</template>
<script>
(function() {
Polymer({
submit: function() {
if (this.$.confirm_password.validity.valid && this.$.password.validity.valid && this.$.email.validity.valid && this.$.fname.validity.valid && this.$.lname.validity.valid) {
console.log("Right!");
this.$.donereg.show();
this.$.ajaxsubmit.go();
}
else{
console.log("Error");
console.log(this.fname);
}
},
gotologin : function() {
document.querySelector('app-router').go('/login');
},
responseChanged : function (oldvalue) {
console.log(this.response);
}
});
})();
</script>
</polymer-element>
我試了.still得到相同的錯誤 – Nani
在你導入替換antislach斜槓 – momolechat
而你的文件夾元素是你的項目的根源? – momolechat