Hi,
First and foremost, thans for a great API!
I do wonder though, how do I format the biography text? (bioURL = 'http://api.themoviedb.org/3/person/18897?api_key=') I wanna split it up in a couple of paragraphs instead of it being a wall of text..
Im a bit new working with API:s so Im sorry if the question might be simple and the answer obvious.
.לא מצאת סרט או סדרה? היכנס כדי ליצור אותם
?רוצה לדרג או להוסיף פריט אל רשימה
?לא חבר אתר
תגובה מאת Travis Bell
ב-פברואר 17, 2016 ב-1:32אחרי חצות יום
Hi shenden,
The API will return
\n
for new lines. You can sub those out with whatever you're doing in your app (ie.<p>
tags if it's HTML).Cheers.
תגובה מאת shenden
ב-פברואר 18, 2016 ב-8:38לפני חצות יום
Hey Travis! Thanks for the quick response!
Yeah I guessed it was something like that, but I still don't get exactly how? Im writing out the data this way: var jjBio = '
' + data.biography + '
'; And it still gives me the same problem. Where do I put the? Sorry again, Im really new at this.
תגובה מאת Travis Bell
ב-פברואר 18, 2016 ב-8:44אחרי חצות יום
Hi Shenden,
There's a few ways you can do this. I am most familiar with Ruby so I can really only provide some examples with it.
Lets say you had a string:
You could do:
You could also use something like Markdown, which is what I actually do on the website (using RedCarpet):
Hope that helps.