I am dealing with a web app based on Google App Engine (Python). I am trying to update a div from a Polymer (HTML) element. The Div I need to update is actually the element's container. To this end, from the element's javascript snippet I am trying to get the div object through Jquery and invoking its load method like
$('#myContainerId').load('/myQueryUrl?id=123123123');
The problem is that I get 405 Method Not Allowed
UPDATE
the url is bound to a Python webapp.RequestHandler through the app's yaml file which implements the get method, makes a query to the ndb and render a Jinja2 template.
UPDATE 2
The error in the consol log, when expanded, says:
k.cors.a.crossDomain.send
n.extend.ajax
n.fn.load
(anonymous function)
j
k.fireWith
x
(anonymous function)
It says there is a cross domain although the domains are actually the same
Use $.ajax() instead of $.load() to control the request/response explicitly. This may do the trick (you may need to adjust the params):
$('#myContainerId').ajax({
crossDomain: FALSE,
type: "POST", // || GET || PUT || DELETE
url: '/myQueryUrl?id=123123123'
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With