-1

Possible Duplicate:
Get query string values in JavaScript

the link is

http://nycs00058260/sites/usitp/_layouts/CreateWebPage_DingDing.aspx?List={74AB081E-59FB-45A5-876D-284607DA03C6}&RootFolder=%3b&Text=%27MDNSO%27

how can I parse the parameter "Text"(at the end) from the url using javascript?

anyone can help me?

Community
  • 1
  • 1
bowang
  • 355
  • 3
  • 6
  • 14

2 Answers2

1

URI.js is a small library that makes working with URLs nice and easy :)

var url = new URI("http://nycs00058260/sites/usitp/_layouts/CreateWebPage_DingDing.aspx?List={74AB081E-59FB-45A5-876D-284607DA03C6}&RootFolder=%3b&Text=%27MDNSO%27");
var queryMap = URI.parseQuery(url.query());
var text = queryMap["Text"];

console.log("Text: ", text);
JonnyReeves
  • 6,119
  • 2
  • 26
  • 28
  • ya it's cook, but how can I parse the current URL, not enter it manually, is there a variable of the current url? – bowang Aug 20 '12 at 16:21