質問をしているときに、stackoverflow は以下のタグ入力で利用可能なタグをどのようにロードしますか? ページが読み込まれたときに使用可能なタグを設定するか、ユーザー入力またはユーザー キーの押下ごとにリクエストを作成しますか? 私は自分のアプリケーションで同じ方法を実装することを計画していますが、これをどのように達成するかについてはわかりません。
質問する
93 次
1 に答える
1
あまりにも多くのタグがあるため、ページの読み込み時に利用可能なすべてのタグを確実に読み込むわけではありません。Firefox の Web コンソールで簡単なテストを実行したところ、AJAX を使用して JSON 要求を行っているようです。例は次のとおりです。
https://stackoverflow.com/filter/tags?q=visual&newstyle=true&_=1359502308905
次の応答が返されます。
[{"Name":"c#","Synonyms":"visual-c#","Count":409187,"Excerpt":"C# is a multi-paradigm programming language encompassing strong typing, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines. It was developed by Microsoft for use with their .NET framework and later approved as a standard by Ecma (ECMA-334) and ISO (ISO/IEC 23270:2006). It is now also available on different platforms (Android, Linux, iOS) via the MONO project."},{"Name":"visual-studio-2010","Synonyms":"visual-studio-2010-rtm","Count":30434,"Excerpt":"Visual Studio is an integrated development environment (IDE) from Microsoft."},{"Name":"visual-studio","Synonyms":"visualstudio","Count":25157,"Excerpt":"Visual Studio is an integrated development environment (IDE) from Microsoft. It supports many different programming languages."},{"Name":"visual-studio-2008","Synonyms":"visualstudio2008","Count":13539,"Excerpt":"This tag refers to the Visual Studio line of software development products from Microsoft, the 2008 version."},{"Name":"visual-c++","Synonyms":"visualc++","Count":12298,"Excerpt":"Microsoft Visual C++ is a C and C++ compiler for Windows. The most recent version of the compiler is Visual C++ 2012, which is available in both commercial editions and in a free Express Edition.\r\n\r\nThe compiler supports the following languages:\r\n\r\n\r\nC: Only the C90 standard is supported; there is very limited C99 support\r\nC++: Also includes support for several major C++11 features as of Visual Studio 2010\r\nC++/CLI and .NET Managed Extensions for C++"},{"Name":"vba","Synonyms":"visual-basic-applications","Count":12195,"Excerpt":"Visual Basic for Applications (VBA) is an event-driven programming language which was first introduced by Microsoft in 1993 to give Excel 5.0 a more robust object-oriented language for writing macros and automating the use of Excel. It is now used for the entire Office suite. If your question is specifically about programming Excel, Access, Word or Outlook, use the appropriate tag: excel-vba, access-vba, word-vba or outlook-vba."}]
また、少し遅れているように見えるため、一度に多くの HTTP リクエストを送信していません。リクエストを実行する前に、1 ~ 2 秒間入力を停止する必要があります。
于 2013-01-29T23:33:10.593 に答える