झलक दिखाने वाला विज़र्ड
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
झलक विज़र्ड को इस तरह से डिज़ाइन किया गया है कि आप अपनी साइट की झलक को तेज़ी से, आसानी से, और भरोसे के साथ इंटिग्रेट कर सकें. आप किताब व्यूअर एम्बेड कर सकते है, 'किताब की खोज' का लिंक दे सकते हैं या अपनी साइट में एक झलक "पॉपअप" विंडो भी जोड़ सकते हैं—आपको बस कोड जनरेट करना होगा और उसे अपने पेज पर चिपकाना होगा. आपके पास कुछ आसान JavaScript फ़ंक्शन का इस्तेमाल करके, इस कोड को पसंद के मुताबिक बनाने का भी विकल्प है.
झलक विज़र्ड एक आसान सुविधा लाइब्रेरी है. इसे हमने डाइनैमिक लिंक और एम्बेड किए गए व्यूअर एपीआई की मदद से बनाया है. अगर आप एक बेहतर डेवलपर हैं और आपको पसंद के मुताबिक बनाए गए इंटिग्रेशन की ज़रूरत है, तो सीधे तौर पर बुनियादी एपीआई का इस्तेमाल करें.
झलक कोड जनरेट करना
जनरेट की गई झलक के उदाहरण
नीचे दिए गए उदाहरण, प्रीव्यू विज़र्ड का इस्तेमाल करके जनरेट किए गए थे.
अपने कोड को पसंद के मुताबिक बनाएं
ऊपर बताए गए विज़र्ड का इस्तेमाल करने के अलावा, आप कुछ आसान JavaScript "helper" फ़ंक्शन को सीधे कॉल कर सकते हैं. ऐसा करने के लिए, आपको पहले Preview विज़र्ड लाइब्रेरी लोड करनी होगी. ऐसा करने का एक तरीका यह है कि आप अपने पेज के <head>
सेक्शन में इस टैग को जोड़ें:
<script type="text/javascript" src="https://books.google.com/books/previewlib.js"></script>
झलक लाइब्रेरी लोड करने के बाद, अपने दस्तावेज़ के <body>
में मौजूद <script>
टैग में जाकर, इनमें से किसी भी फ़ंक्शन को कॉल किया जा सकता है. उदाहरण के लिए, अगर आपको "Google का प्रीव्यू" बटन डालना है, तो ऐसा करने के लिए कोड को <script>
एलिमेंट में, पेज में बटन के हिसाब से अपनी पसंद की जगह पर डालें.
GBS_setLanguage
GBS_setLanguage(languageCode)
इस फ़ंक्शन को कॉल करने के बाद जोड़े गए किसी भी बटन या टेक्स्ट की भाषा बदल देता है. इसमें "Google झलक" बटन की भाषा, एम्बेड की गई झलक की इंटरफ़ेस भाषा वगैरह शामिल है.
पैरामीटर:
string languageCode
- आपकी पसंद का आरएफ़सी 3066 भाषा कोड (अंग्रेज़ी के लिए डिफ़ॉल्ट रूप से 'en' होता है). फ़िलहाल, इन भाषाओं के कोड का इस्तेमाल किया जा सकता है: hy, bg, ca, zh-CN, zh-TW, hr, cs, da, nl, en, fil, fi, fr, de, el, hi, hu, is, id, in, it, ja, ko, lv, lt, no, pl, ko, lv, lt, no, pl, pt-BR, pt-PT, pl, pt-BR, pt-PT,
GBS_setViewerOptions
GBS_setViewerOptions(optionObj)
पैरामीटर:
Object optionsObj
- की-वैल्यू पेयर का सेट, जिसे एम्बेड किए गए व्यूअर एपीआई के DefaultViewer कंस्ट्रक्टर को पास किया गया है. आम तौर पर, इसका इस्तेमाल बेहतर कस्टमाइज़ेशन के लिए किया जाता है.
GBS_setCobrandName
GBS_setCobrandName(cobrandName)
यह फ़ंक्शन, इसे Partner Program में पब्लिशर के इस्तेमाल के लिए बनाया गया है. इस फ़ंक्शन की मदद से, को-ब्रैंडेड सर्च साइट को बुक सर्च में झलक वाले लिंक डालते समय इस्तेमाल किया जा सकता है. बटन लगाने से पहले इस फ़ंक्शन को कॉल करने से, यह सुनिश्चित होता है कि उपयोगकर्ता को पुस्तक खोज पूर्वावलोकन के ऊपर भागीदार का लोगो दिखाई दे.
पैरामीटर:
string cobrandName
- किसी भी Book Search यूआरएल में जोड़ा जाने वाला कोब्रैंड नाम. यह आम तौर पर मौजूदा को-ब्रैंडेड खोज की झलक दिखाने वाले यूआरएल में /p/
के बाद आता है.
उदाहरण के लिए, इस वैल्यू को sup
पर सेट करने पर, उपयोगकर्ता को डिफ़ॉल्ट लिंक के बजाय
https://books.google.com/books/p/sup?id=Q8ysL64pM54C&printsec=frontcover
जैसे लिंक पर भेजा जाएगा
https://books.google.com/books?id=Q8ysL64pM54C&printsec=frontcover
GBS_insertEmbeddedViewer
GBS_insertEmbeddedViewer(identifier, opt_width, opt_height)
जहां भी इस फ़ंक्शन को कॉल किया जाता है वहां एम्बेड की गई किताब की झलक शामिल की जाती है. अगर झलक उपलब्ध नहीं है, तो कोई दर्शक नहीं दिखाया जाता.
पैरामीटर:
Number opt_width
- दर्शक की मनचाही चौड़ाई, पिक्सल में.
Number opt_height
- दर्शक की लंबाई (पिक्सल में).
GBS_insertPreviewButtonPopup(identifiers)
अगर किताब की झलक उपलब्ध है, तो यह फ़ंक्शन "Google पर झलक देखें" बटन लिखता है. इस बटन को क्लिक करने से, आपके पेज के ठीक ऊपर "फ़्लोटिंग झलक विंडो" खुलती है. अगर कोई झलक उपलब्ध नहीं है, तो बटन नहीं बनाया जाएगा.
ज़्यादा बेहतर डेवलपर को एम्बेड किए गए दर्शक एपीआई में दिलचस्पी हो सकती है, जिसका इस्तेमाल यह फ़ंक्शन अंदरूनी तौर पर करता है.
पैरामीटर:
string, Array identifier
- झलक का यूआरएल या किताब का आइडेंटिफ़ायर, जैसे कि ISBN, OCLC या LCCN नंबर. डाइनैमिक लिंक के अनुरोध का फ़ॉर्मैट देखें. अगर आपको किताब के कई वैकल्पिक आइडेंटिफ़ायर के बारे में पता है, तो इन आइडेंटिफ़ायर के कलेक्शन को पास किया जा सकता है. अगर इनमें से किसी भी आइडेंटिफ़ायर की झलक उपलब्ध होगी, तो यह बटन दिखेगा.
GBS_insertPreviewButtonLink(identifiers, opt_options)
अगर किताब की झलक उपलब्ध है, तो यह फ़ंक्शन एक "Google पर झलक देखें" बटन लिखता है जो सिर्फ़ किताब के झलक पेज से लिंक करता है. डिफ़ॉल्ट रूप से, यह Google Books पर किताब की झलक से लिंक होता है. हालांकि, यहां दिए गए काम भी किए जा सकते हैं:
- लिंक किया गया है (जिसमें, एम्बेड किया गया व्यूअर शामिल होना चाहिए).
alternativeUrl
विकल्प को पास करके, ऐसा किया जा सकता है.
- को किताब के झलक दिखाने वाले पेज के को-ब्रैंडेड वर्शन के लिंक का इस्तेमाल करना होगा. ऐसा तब ही होगा, जब इस फ़ंक्शन से पहले GBS_setCobrandName का इस्तेमाल किया जाए.
अगर उपयोगकर्ता को झलक देखने की सुविधा उपलब्ध नहीं है, तो पेज पर कोई बटन नहीं खोला जाएगा.
पैरामीटर:
string, Array identifier
- झलक का यूआरएल या किताब का आइडेंटिफ़ायर, जैसे कि ISBN, OCLC या LCCN नंबर. डाइनैमिक लिंक के अनुरोध का फ़ॉर्मैट देखें. अगर आपको किताब के कई वैकल्पिक आइडेंटिफ़ायर के बारे में पता है, तो इन आइडेंटिफ़ायर के कलेक्शन को पास किया जा सकता है. अगर इनमें से किसी भी आइडेंटिफ़ायर की झलक उपलब्ध होगी, तो यह बटन दिखेगा.
Object opt_options
- ज़रूरी नहीं - नाम और वैल्यू वाला मैप, जिसका इस्तेमाल बटन के काम करने के तरीके को कॉन्फ़िगर करने के लिए किया जाता है. फ़िलहाल, सिर्फ़ एक विकल्प मान्य है: alternativeUrl
. उदाहरण के लिए, अगर आप अपनी साइट के कस्टम झलक पेज से Google के 'झलक देखें' बटन को लिंक करना चाहते हैं, तो नीचे दी गई जानकारी को दूसरे तर्क के तौर पर GBS_insertPreviewButtonLink
को दें:
{ 'alternativeUrl' : 'http://yoursite.com/your-preview-page' }
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2024-06-28 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2024-06-28 (UTC) को अपडेट किया गया."],[],[],null,["# Preview Wizard\n\nThe Preview Wizard is designed to let you quickly, easily, and reliably integrate previews with your site. You can embed a book viewer, link to Book Search, or even add a preview \"popup\" window to your site---all you need to do is [generate the code](#generateCode) and paste it onto your page. You can also [customize this code](#customizeYourCode) using some simple JavaScript functions.\n\nThe Preview Wizard is a simple convenience library we built on top of our [Dynamic Links](/books/docs/dynamic-links) and [Embedded Viewer](/books/docs/viewer/developers_guide) APIs. If you're an advanced developer looking for customized integration, consider\nusing the underlying APIs directly.\n\nGenerate your preview code\n--------------------------\n\n#### Enter book identifiers\n\nTell us all the ISBNs or other identifiers you know of for this book. If we can find a preview associated with any of these numbers, we can make it available to your site's users:\n\n|--------------------------------------|---|\n| ISBN OCLC number LCCN Book Search ID | |\n| ISBN OCLC number LCCN Book Search ID | |\n| ISBN OCLC number LCCN Book Search ID | |\n\n[Enter more identifiers...](about:invalid#zGoSafez)\n\n#### Choose how to show the book preview\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| If a preview is available for this book, what should the user see on your page? |---|------------------------------------------------------------------------| | | An embedded book viewer. Viewer size: pixels wide, pixels high | | | A button that opens a floating book viewer. | | | A button that links to the book's preview page on Book Search. | | | A button that goes to a custom preview page on your site. Preview URL: | If no preview can be found for the specified book(s), the preview or button will be automatically disabled and nothing will appear. | |\n\n#### Select your language\n\nChinese (Simplified) Chinese (Traditional) Dutch English French German Italian Japanese Portuguese (Brazilian) Russian Spanish\n\n#### Generate code for your web page\n\nExamples of generated previews\n------------------------------\n\nThe following examples were generated using the Preview Wizard.\n\n- [previewwizard-embed](/books/examples/previewwizard-embed): Embeds a book viewer on the page.\n- [previewwizard-popup](/books/examples/previewwizard-popup): Adds a button that can be clicked to open a floating preview over the page.\n- [previewwizard-linktogbs](/books/examples/previewwizard-linktogbs): Inserts a button that links to the preview on the Book Search site.\n- [previewwizard-customurl](/books/examples/previewwizard-customurl): Shows a button that goes to a specific URL.\n\nCustomize your code\n-------------------\n\nIn addition to using the wizard above, you can call some simple JavaScript \"helper\" functions directly. To do this, you should first load the Preview Wizard library. One way to do this is by adding the following tag to the `\u003chead\u003e` section of your page: \n\n```\n\u003cscript type=\"text/javascript\" src=\"https://books.google.com/books/previewlib.js\"\u003e\u003c/script\u003e\n```\n\nHaving loaded the preview library, you can then call any of the following functions from within `\u003cscript\u003e` tags inside your document's `\u003cbody\u003e`. For example, if you'd like to insert the \"Google Preview\" button, you'd put the code to do so in a `<script\u003e` element at the button's desired position within the page.\n\n### GBS_setLanguage\n\n```\nGBS_setLanguage(languageCode)\n```\n\nChanges the language of any buttons or text added after this function is called. This includes the language of the \"Google Preview\" button, the interface language of the embedded preview, and so on.\n\n\u003c!-- --\u003e\n\n**Parameters:** *string*` languageCode ` - The desired RFC 3066 language code (default is 'en' for English). Currently supported language codes include hy, bg, ca, zh-CN, zh-TW, hr, cs, da, nl, en, fil, fi, fr, de, el, hi, hu, is, id, in, it, ja, ko, lv, lt, no, pl, pt-BR, pt-PT, ro, ru, sr, sk, sl, es, sv, th, tr, uk, and vi.\n\n### GBS_setViewerOptions\n\n```\nGBS_setViewerOptions(optionObj)\n```\n\n**Parameters:** *Object*` optionsObj ` - A set of key-value pairs passed to the Embedded Viewer API's [DefaultViewer constructor](/books/docs/viewer/reference#google.books.DefaultViewer). Typically, this is used for advanced customizations.\n\n### GBS_setCobrandName\n\n```\nGBS_setCobrandName(cobrandName)\n```\n\nIntended for use by publishers in the [Partner Program](https://books.google.com/partner), this function sets the [Co-Branded Search](https://books.google.com/support/partner/bin/answer.py?hl=en&answer=65113) site to be used when inserting any preview links to Book Search. Calling this function before inserting a button ensures that users see the partner's logo above the Book Search previews.\n\n\u003c!-- --\u003e\n\n**Parameters:** *string*` cobrandName ` - The cobrand name to be added to any Book Search URLs. This is typically what comes after `/p/` in existing Co-Branded Search preview URLs.\n- For example, setting the value to `sup` will send the user to links like \n `https://books.google.com/books/p/sup?id=Q8ysL64pM54C&printsec=frontcover` \n rather than the default \n `https://books.google.com/books?id=Q8ysL64pM54C&printsec=frontcover`\n\n### GBS_insertEmbeddedViewer\n\n```\nGBS_insertEmbeddedViewer(identifier, opt_width, opt_height)\n```\n\nInserts an embedded book preview wherever this function is called. If the preview is unavailable, no viewer is shown.\n\n\u003c!-- --\u003e\n\n**Parameters:** *string*` identifier ` - A preview URL or book identifier such as an ISBN, OCLC, or LCCN number. See [Dynamic Links request format](/books/docs/dynamic-links#requestFormat).\n\u003c!-- --\u003e\n\n*Number*` opt_width ` - The desired width of the viewer, in pixels.\n\u003c!-- --\u003e\n\n*Number*` opt_height ` - The desired height of the viewer, in pixels.\n\n### GBS_insertPreviewButtonPopup\n\n```\nGBS_insertPreviewButtonPopup(identifiers)\n```\n\nIf the book preview is available, this function writes out a \"Google Preview\" button. Clicking this button opens a \"floating preview window\" right on top of your page. If no preview is available, the button is not drawn.\n- More sophisticated developers may be interested in the [Embedded Viewer API](/books/docs/viewer/developers_guide), which this function uses internally.\n\n\u003c!-- --\u003e\n\n**Parameters:** *string, Array*` identifier ` - A preview URL or book identifier such as an ISBN, OCLC, or LCCN number. See [Dynamic Links request format](/books/docs/dynamic-links#requestFormat). If you know of several alternative identifiers for the book, you can pass an array of these identifiers, and the button will appear if a preview is available for any one of them.\n\n### GBS_insertPreviewButtonLink\n\n```\nGBS_insertPreviewButtonLink(identifiers, opt_options)\n```\n\nIf the book preview is available, this function writes out a \"Google Preview\" button that simply links off to a preview page for the book. By default, this links to the preview on Google Books, but you can also:\n- link to a URL on your site (which should, in turn contain an embedded viewer). You can do this by passing an optional `alternativeUrl` option.\n- link to a Co-Branded version of the book preview page, if [GBS_setCobrandName](#GBS_setCobrandName) is called before this function.\nIf no preview is available to the user, no button is drawn onto the page.\n\n\u003c!-- --\u003e\n\n**Parameters:** *string, Array*` identifier ` - A preview URL or book identifier such as an ISBN, OCLC, or LCCN number. See [Dynamic Links request format](/books/docs/dynamic-links#requestFormat). If you know of several alternative identifiers for the book, you can pass an array of these identifiers, and the button will appear if a preview is available for any one of them.\n\u003c!-- --\u003e\n\n*Object*` opt_options ` - *optional* - A name-value map used to configure the behavior of the button. Currently one option is supported: `alternativeUrl`. For example, to have the Google Preview button link to a custom preview page on your site, simply pass the following as a second argument to `GBS_insertPreviewButtonLink`: \n` { 'alternativeUrl' : 'http://yoursite.com/your-preview-page' } `"]]