<ajx-api
id="api1"
in1='uname'
in2='pass'
></ajx-api>
</body>
<script src="_js/jquery-1.6.3.min.js"></script>
<script>
$(document).ready(function() {
//$('#form').submit(function() {
var x=document.querySelector("ajx-api ");
var y=document.getElementById("api1");
console.log(x);
console.log(y);
y.reqAjx();
x.reqAjx();
//}); // end submit
}); // end ready
</script>
Element
<dom-module id="ajx-api" >
<template>
<iron-ajax
id="iajax"
handle-as="json"
on-response="hresponse"
></iron-ajax>
</template>
<script>
(function(){
Polymer(
{
is: "ajx-api",
properties: {
prms: Object,
in1: {
type: String,
value: ""
},
in2: {
type: String,
value: "taco"
}
},
hresponse: function(request) {
},
reqAjx: function () {
this.$.iajax.url = this.url_d;
this.$.iajax.method = this.met;
if(this.$.iajax.method=="get") {
this.$.iajax.params = this.parms;
}
else {
this.$.iajax.body = this.parms;
}
},
});
});
</script>
</dom-module>