1👍
I would guess its the ‘this.id’, try using on alert(this.id) before the $.get to see what its producing (or not).
I do something similar which should give you the idea
$(".productpicturedelete").on("click", "input[type=button]", function(event){
var $buttonid = $(this).attr("id");
👤Foxy
0👍
Data source file name is missing in URL field:
$.get(“/models/”+this.id+”/viewmodelinfo/<data source file name>”, function(data) {..});
👤KSL
0👍
<script type="text/javascript">
$(document).ready(function() {
$('.cadlib').bind('click', function () {
data_id = $(this).attr('id'); //add this
$.get("/models/" + data_id + "/viewmodelinfo/", function(data) {
alert ("yo"); // This line bellow doesn't execute
if (data.fact_type=="T") {
guess_result="This fact is true! " + data.fact_note;
} else {
alert ("yo");
guess_result="This fact is false! " + data.fact_note;
}
$('#result').replaceWith("guess_result");
});
});
});
</script>
- [Answer]-Django admin – how to retrieve original value from DB
- [Answer]-Can I disallow delete queries on all instances of a resource in tastypie?
- [Answer]-Django create_or_update(), unique_together, unique, and primary
0👍
I am almost sure that this.id doesn’t exists in this context
$.get("/models/"+this.id+"/viewmodelinfo/", function(data)
What does this.id suppouse to be? Can you explain it please
- [Answer]-Heroku won't allow me to rename DB and thus can't run Django unit tests?
- [Answer]-Django build_absolute_uri throwing NoReverseMatch error
- [Answer]-Python django – user object not found
- [Answer]-Pass variable through url to view
- [Answer]-Django: FormView: How to add initial logic?
Source:stackexchange.com