دعم الموقع

There is a great example that I used successfully with your old database a few years ago. https://www.smashingmagazine.com/2012/02/beginners-guide-jquery-based-json-api-clients/ This doesn't work with the current db, can you please send a link to working examples. My jquery is rusty and I've been trying to figure out which } or ) or ; I'm missing for the past hour. If I come up with a working one before you answer I'll post it.

7 ردود (على هذه الصفحة 1 من 1)

Jump to last post

Here's a working jQuery example that uses search. Make sure to change line 11 with your API key.

That was quick! Thanks for the fast reply! No, unfortunately I mean I need a lot more, as in something with a working input box. I took your code and inserted my api and did in fact get results for the fight club options. Now I'd like to be able to get an input box that will output any movie results, not just fight club. The really great working example above had a way to get a poster. I'm trying to combine both you and the other example. Here is what I have that doesn't work at all.: (by the way it is ok if you just say, "no, I don't code for free", like I said I'll eventually figure this out and post my own example) Thank you!!

<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>jQuery Test</title>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
</head>
<body>




  <h2>jQuery Test</h2>
  <h3>Results</h3>

  <p id="error"></p>
  <ul id="search_results"></ul>
     <div id="fetch">
      <input type="text" placeholder="Enter a movie title" id="term" />
      <button id="search">Find me a poster</button>
   </div>
   <div id="poster"></div>


  <script type="text/javascript" charset="utf-8">
    var api_key = 'mysecretapikey';
  $(document).ready(function(){
      $.ajax({
        url: 'http://api.themoviedb.org/3/search/movie?api_key=' + api_key + '&query=',
        dataType: 'jsonp',
        jsonpCallback: 'testing'
      }).error(function() {
        console.log('error')
      }).done(function(response) {
       if (response.total_results > 0) 
        {
        content = "";
            for (i = 0; i < response.total_results; i++) 
            {
            url = response.results[i].poster_path;
            content += "";
            };
        $("#poster").html(content);
            }
      });

    });
        </script>
</body>
</html>
$(document).ready(function(){
      $.ajax({
        url: 'http://api.themoviedb.org/3/search/movie?api_key=' + api_key + '&query=',
        dataType: 'jsonp',
        jsonpCallback: 'testing'
      }).error(function() {
        console.log('error')
      }).done(function(response) {
       if (response.total_results > 0) 
        {
        content = "";
            for (i = 0; i < response.total_results; i++) 
            {
            url = response.results[i].poster_path;
            content += "";
            };
        $("#poster").html(content);
            }
      });

    });

Hi there,

If you have more specific implementation questions, I would suggest asking your question on something like Stack Overflow.

Cheers.

There used to be working examples on the site - are the located somewhere else or are they just removed?

found a working example! http://anthonybrown.github.io/movie-poster/

pure brilliant genius. Just have to change two things to get it working: var api key: "your api key here"; var baseimg = "http://image.tmdb.org/t/p/w185//";

Happy to hear you figured it out.

لم تجد الفلم أو المسلسل ؟ سجل دخولك و انشئها

عام

s ركز شريط البحث
p افتح قائمة الملف الشخصي
esc اغلق النافذة المفتوحة
? افتح نافذة اختصارات لوحة المفاتيح

على كافة صفحات الوسائط

b ارجع للخلف (او للصفحة الام عند التطبيق)
e انتقل لصفحة التعديل

على كافة صفحات موسم المسلسل

(السهم الايمن) انتقل للموسم التالي
(السهم الايسر) انتقل للموسم السابق

على كافة صفحات حلقة المسلسل

(السهم الايمن) انتقل للحلقة التالية
(السهم الايسر) انتقل للحلقة السابقة

على كافة صفحات الصور

a افتح صفحة اضافة الصورة

على كافة صفحات التعديل

t افتح محدد الترجمة
ctrl+ s ارسال النموذج

على صفحات المناقشة

n انشى نقاش جديد
w تبديل حالة المتابعة
p تبديل عام / خاص
c تبديل اغلاق / فتح
a افتح الانشطة
r رد على النقاش
l انتقل لأخر رد
ctrl+ enter أرسل رسالتك
(السهم الايمن) الصفحة التالية
(السهم الايسر) الصفحة السابقة

الاعدادات

هل تريد تقييم او اضافة هذا العنصر للقائمة؟

تسجيل الدخول