Home > front end >  $. GetJSON () is invalid, for advice, thank you very much
$. GetJSON () is invalid, for advice, thank you very much

Time:11-02

Js code for
 
$(function () {
Var $button=$(" # aaa ");
$button. Click (function () {
The console. The log (1);
Var initUrl='http://127.0.0.1:8000/souye/aaa/';
The username=3040284313;
$. GetJSON (initUrl, {' username: the username}, function (data) {
The console. The log (data)
});
});
});

HTML code to the
 


Python code is:
 
Def aaa (request) :
Data={
https://bbs.csdn.net/topics/'MSG' : 'the user can use'
}
Return JsonResponse (data=https://bbs.csdn.net/topics/data)


Additional qualifications to urls. Py there are:
 
Souye path ('/', include (' souye. Urls', 'souyee'), the namespace='souyee')),

Subprojects urls. Py there are:
 
Path (' aaa/' views. Aaa, name='aaa'),


After clicking the button, it will only output 1, other all have no, that is, no enter getJSON configuration url
No way out, for help,
  • Related