DCSIMG
Getting Query String Parameters with JavaScript in SharePoint - itaysk

Getting Query String Parameters with JavaScript in SharePoint

Posted Sunday, November 30, 2008 11:07 AM by Itay Shakury

The JSRequest class is a JavaScript object that lives on all SharePoint Pages, and allows us to simply and quickly get query string parameters using JavaScript.

It has 3 fields: QueryString, FileName, and PathName.

  • QueryString - is an array of key\value pairs representing the current query string parameters.
  • FileName - is a string containing the current name of the current page.
  • PathName - is the server relative path of the current page.

Usage:

//First we must call the EnsureSetup method
JSRequest.EnsureSetup(); 

//Get a query string parameter called ItemId. i.e - "page.aspx?ItemId=11" will return 11
itemId = JSRequest.QueryString["ItemId"];

//Get the current page name. i.e - "default.aspx"
itemId = JSRequest.FileName;

//Get the current path name. i.e - "/itaysk/doclib/default.aspx"
itemId = JSRequest.PathName;

I have found no proper documentation for this so I hope it can help.

 

-- My name is Itay Shakury (itaysk) and I am a SharePoint consultant --

תגים:,

Comments

# Links (11/30/2008) « Steve Pietrek - Everything SharePoint

Pingback from  Links (11/30/2008) « Steve Pietrek - Everything SharePoint

# WSS 3.0 & MOSS: Recopilatorio de enlaces interesantes (XXIII)!

Monday, December 01, 2008 1:15 PM by Blog del CIIN

Una vez más, os presentamos el clásico recopilatorio de recursos interesantes aparecidos en torno a la

# WSS 3.0 & MOSS: Recopilatorio de enlaces interesantes (XXIII)! « Pasi??n por la tecnolog??a…

Pingback from  WSS 3.0 & MOSS: Recopilatorio de enlaces interesantes (XXIII)! « Pasi??n por la tecnolog??a…

# Power User Toolbox: JavaScript for SharePoint - Pt4 : End User SharePoint

Pingback from  Power User Toolbox: JavaScript for SharePoint - Pt4 : End User SharePoint

# Hot links - 1st Week of December 2008

Sunday, December 07, 2008 9:59 PM by ~ YESChandana ~

Hot links - 1st Week of December 2008

# Power User Toolbox: JavaScript for SharePoint - Pt7 | End User SharePoint

Pingback from  Power User Toolbox: JavaScript for SharePoint - Pt7 | End User SharePoint

# SharePoint JavaScript Functions Overview

Wednesday, December 10, 2008 9:46 AM by Confluence: SharePoint Development Wiki

Map of Reusable SharePoint JavaScript JSRequest version: WSS 3.0 source file: init.js (ln 1621) mapped by: Itay Shakury

# ?????????????????? ?????????????????? ?????????????? ?????????????????? JavaScript SharePoint « using Microsoft.SharePoint;

Pingback from  ?????????????????? ?????????????????? ?????????????? ?????????????????? JavaScript SharePoint « using Microsoft.SharePoint;

# Hot links - 1st Week of December 2008

Monday, January 26, 2009 12:29 PM by Admin's Blog

Customizing SharePoint with third party applications ( Link ) Getting Query String Parameters with JavaScript

# SharePoint Tip/Trick: Getting Query String Parameters with JavaScript « DevExpertise

Pingback from  SharePoint Tip/Trick: Getting Query String Parameters with JavaScript « DevExpertise

# Getting Query String Parameters with JavaScript in SharePoint | John @ Enable

Pingback from  Getting Query String Parameters with JavaScript in SharePoint | John @ Enable

# re: Getting Query String Parameters with JavaScript in SharePoint

Wednesday, November 24, 2010 6:54 PM by Arnold Smith

Itay,

Thanks for publishing this! I've been scratching my head for a couple of days over this.

-Arnold

# re: Getting Query String Parameters with JavaScript in SharePoint

Tuesday, January 11, 2011 4:03 AM by Adursepes

Buen comienzo

# re: Getting Query String Parameters with JavaScript in SharePoint

Wednesday, December 21, 2011 10:22 AM by quorepopleLog

gdjutze8jSJRR <a href="http://bryanpeabody.com">uggs">http://bryanpeabody.com">uggs on sale for women</a> inqitfg1xGPIY http://bryanpeabody.com

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: