<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dialog Archives : Binary Bits</title>
	<atom:link href="https://blog.binarybits.net/tag/dialog/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.binarybits.net/tag/dialog/</link>
	<description>Bits &#38; Pieces - A blog by Kannan Balasubramanian</description>
	<lastBuildDate>Mon, 03 May 2021 10:50:10 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Open SharePoint PDF documents in modal dialog</title>
		<link>https://blog.binarybits.net/open-sharepoint-pdf-documents-in-modal-dialog/</link>
					<comments>https://blog.binarybits.net/open-sharepoint-pdf-documents-in-modal-dialog/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Mon, 13 Nov 2017 05:43:59 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Dialog]]></category>
		<category><![CDATA[Modal]]></category>
		<category><![CDATA[Modal Dialog]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=958</guid>

					<description><![CDATA[<p>Sometimes we need PDF documents to be opened in dialogs instead of SharePoint&#8217;s default behavior which is opening the document in the same window or tab. The following code helps in implementing this. Note: This code only works for PDF documents. For office documents look at the next article. &#60;script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.2.1.min.js"&#62;&#60;/script&#62; &#60;script type="text/javascript"&#62; $("a[href$='.pdf']").each(function() [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/open-sharepoint-pdf-documents-in-modal-dialog/">Open SharePoint PDF documents in modal dialog</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Sometimes we need PDF documents to be opened in dialogs instead of SharePoint&#8217;s default behavior which is opening the document in the same window or tab.</p>
<p>The following code helps in implementing this.</p>
<p>Note: This code only works for PDF documents. For office documents look at the next article.</p>
<pre title="Open document links in SharePoint modal dialog" class="lang:js decode:true">&lt;script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.2.1.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
    $("a[href$='.pdf']").each(function() {
        $(this).removeAttr("onclick").attr("href", "javascript:OpenDocumentInDialogue(\"" + this.href + "\")");
    });

    function OpenDocumentInDialogue(href) {
        var o;
        $("body").append("&lt;div id='docTemp' style='min-height:600px;min-width:800px;height:100%;overflow:hidden'&gt;&lt;object data='" + href + "' width='100%' height='100%' type='application/pdf' &gt;&lt;/object&gt;&lt;/div&gt;");
        o = {};
        o.html = $("#docTemp")[0];
        o.showMaximized = true;
        o.title = href.substring(href.lastIndexOf("/") + 1);
        o.dialogReturnValueCallback = OpenDocumentInDialogueCallback;
        SP.UI.ModalDialog.showModalDialog(o);
    }

    function OpenDocumentInDialogueCallback() {
        // Do something here when the dialog closes
    }
&lt;/script&gt;</pre>
<p>&nbsp;</p>
<p>The post <a href="https://blog.binarybits.net/open-sharepoint-pdf-documents-in-modal-dialog/">Open SharePoint PDF documents in modal dialog</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/open-sharepoint-pdf-documents-in-modal-dialog/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: blog.binarybits.net @ 2026-04-23 06:39:32 by W3 Total Cache
-->