Sunday, 15 June 2014

jquery - Pull data into full calendar using php -


I am trying to drag event data to use php in my full calendar. I have successfully acquired the data from the database and converted it into Jason but I have a problem.

Here is the JSON output:

  [{"id": "53," Start ":" 2013-06-06 "," title ":" Assignment 2 {"Id": "52", "Start": "2013-06-07," "title": "good luck 1"}, {"id": "54", "start": "2013- 06-08 "," Title ":" Assignment 3 "}]   

So when I want it to do this by putting it in my full calendar:

  Var class_id = $ ("# calendar"). Attr ('c_id'); $ ("# calendar") .FullCalendar ({daysClick: function (data) {}, Event: '/ classes / get_due_dates /' + c_id });   

When I did not see anything on the calendar Yes, but when I pasted copy and output and removed the quote around id, beginning and title, then it worked fine

similarly:

  [ Id: "53", Start: "2013-06-06", Title: "Assignment 2"}, {id: "52", Start: "2013- 06-07", Title: "Assignment 1"}, { ID: "54", Start: "2013-06-08", Title: "Assignment 3"}   

Ignore quotation marks have been removed, so my question is How can I convert that output into I am receiving and removing those quotes so that I can display these events on my calendar?

Thank you!

Try it if you want it to be what it is.

  & lt ;? Php $ str = '[{ID: "53", "Start": "2013-06-06", "Title": "Assignment 2"}, {"id": "52", "Start": "2013-06-07", "title": "assignment 1"}, {"id": "54", "start": "2013-06-08", "title": "assignment 3"}] ; $ Str = str_replace (',', '' ',' str, '' str '' (':', ':', $ str); $ str = str_replace (',', '', ',' $ Str); resonant "pre <"> $ str. "& Lt; / Pre & gt; "?? & gt;    

No comments:

Post a Comment