Loading...
Copy code
Close
Permalink
Close
Please tell us why you want to mark the subject as inappropriate.
(Maximum 200 characters)
Report Inappropriate
Cancel
Private Message
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Cancel
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Update
Cancel
Feedback
Email ID
Subject :
Comments :
Send
Cancel
Private Message
Type the characters you see in the picture below.
Type the characters you see in the picture below.
Attach files
Desktop
Google Docs
Each Attachment size should not exceed 0 Bytes.
Max no of attachments : 0
Loading User Profile...
guest
Response title
This is preview!
Attachments
Publish
Back to edit
Cancel
(
)
Sign In
You can also use the below options to login
Login with Facebook
Login with Google
Login with Yahoo
New to this Portal?
Click on Join Now to Sign Up
Join Now
Home
All Forums
JavaScript
Move this topic
Forum :
FuncUnit
StealJS
General JavaScriptMVC
DocumentJS
jQueryMX
CanJS
jQuery++
Sub forum :
Move this topic
Cancel
jQueryMX
Model
stephane...
Fixture request does not work why ?
in
jQueryMX
•
Model
•
6 years ago
Hi I am working on a project that use fixture, the problem is when I create a new element with the model create function that use fixture to simulate ajax. Nothing happens on the screen eventough I have followed all the instructions to make working.
My model :
$.Model('Comment', {
findAll : 'GET /moment/{momentId}/comments',
create : function(opt, success, error){
console.log('comment create');
return $.ajax({
url: '/moment/{momentId}/comment',
fixture: '//fixture/json/moments_list_1.json',
type: 'post',
success: success,
error: error
});
},
update : function(opt, success, error){
console.log('comment update');
return $.ajax({
url: '/moment/{momentId}/comment/{commentId}',
type: 'put',
success: success,
error: error
});
},
destroy : 'DELETE /moment/{momentId}/comment/{commentId}'
});
My function that call the model :
'#comment_field keypress' : function(el, ev){
if (ev.which == 13) {
Comment.create({
momentId : $("#comment_id").val(),
comment : el.val()
},
function(newAttrs) {
console.log(newAttrs);
});
el.val('');
}
}
and my fixture request :
$.fixture("/moment/{momentId}/comment","/resources/js/fixture/json/moments_list_1.json");
// comment
$.ajax({type: "post",
url: "/moment/{momentId}/comment",
fixture: "/resources/js/fixture/json/moments_list_1.json"
});
1
Replies(1)
Justin Me..
Re: Fixture request does not work why ?
6 years ago
Is this an older project? Anyway you could simplify the example?
Leave a comment on Justin Meyer's reply
Change topic type
Topic Type :
Discussions
Questions
Ideas
Problems
No of days :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Change topic type
Cancel
Link this topic
Provide the permalink of a topic that is related to this topic
Permalink
Save
Close
Reply to stephane.lemaitre's question
Top
Reply
{"z165885":[32525000001636013],"z31487743":[32525000001608010]}
Statistics
1
Replies
2395
Views
0
Followers
Tags
No tags available for this topic.
Cancel
Actions
Permalink
© Bitovi - JavaScriptMVC Training and Support