Showing posts with label Browser. Show all posts
Showing posts with label Browser. Show all posts

Tuesday, September 24, 2013

JavaScript Back to Previous Page functionality on a button click

Hi Pals,
In this post we are going to see How to go back to previous page using Javascript on click of anchor button.

Below is the script which will take you to the previous page upon clicking on Back to previous page button.

<a href="#" onClick="history.go(-1)"> Back to Previous Page </a>

Saturday, February 23, 2013

Set this url as default/Home page of your browser


In this post we are going to set any url as default/Home page of your browser.
Recently one of my friend asked me to do this. So thought of sharing with you guys as well.
Consider we are going to set the http://www.google.co.in as the Default/Home page of the browser.

Add a below anchor tag to your webpage
<A style="CURSOR: hand; font-decoration: underline" href="#" onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.google.co.in');">set as your home page</A>

So when user clicks on this button, a popin will appear asking to set google as the home page.
Just click on Ok. That's it, your browser has been updated with the default/Home page as google.com


Hope this helps...


Tuesday, September 6, 2011

How to open PDF files,HTML files in browser in Sharepoint 2010

Below are the few methods to Open PDF files,HTM files in browser in Sharepoint 2010 ::

Web Application level setting: Method 1 (UI)

• Go to SharePoint 2010 Central Administration > Application Management > Manage Web Applications
• Select the row of your web application
• Click General Settings in the ribbon
• Scroll down to Browser File Handling and select Permissive
• Click Ok

Web Application level setting: Method 2

1
2
3
$webApp = Get-SPWebApplication http://intranet.domain/
$webApp.BrowserFileHandling = "permissive"
$webApp.update()


Web Application level setting: Method 3 (recommended)


1
2
3
4
5
6
7
8
9
10
$webApp = Get-SPWebApplication http://intranet.domain/
If ($webApp.AllowedInlineDownloadedMimeTypes -notcontains "application/pdf")
{
  Write-Host -ForegroundColor White "Adding Pdf MIME Type..."
  $webApp.AllowedInlineDownloadedMimeTypes.Add("application/pdf")
  $webApp.Update()
  Write-Host -ForegroundColor White "Added and saved."
} Else {
  Write-Host -ForegroundColor White "Pdf MIME type is already added."
}


Site Collection level


1
2
3
4
5
6
7
8
9
10
11
12
foreach ( $subsite in $site.allwebs ) 
 foreach ($list in $subsite.Lists) 
 { 
  if($list.browserfilehandling -eq "Strict") 
  { 
   $list.browserfilehandling = "Permissive"; 
   $list.update(); 
  } 
 } 
}


Site level ( SPWeb )


1
2
3
4
5
6
7
8
9
foreach ($list in $web.Lists) 
 if($list.browserfilehandling -eq "Strict") 
 { 
  $list.browserfilehandling = "Permissive"; 
  $list.update(); 
 } 
}


List Level


1
2
3
4
5
6
7
$list = $web.Lists["MyList"] 
if($list.browserfilehandling -eq "Strict") 
 $list.browserfilehandling = "Permissive"; 
 $list.update(); 
}



Hope this helps...

Popular Posts