0

Is there a way to grab document library name from the URL using jquery? This ( How to obtain document library name from the URL ) is a good link but I need to use jquery

For example: https://Pros.Canada.ProSource.com/sites/CandidateSource/Campaign23/Forms/EditForms.aspx?ID=333223 (etc.)

There are two lookup up fields (Campaign and Campaign Number) on this page. Idea is to when recruiter go to this page, i want jquery to grab the campaign and campaign number from the url and stick it in the Campaign and Campaign Number box. so recruiter dont have to manually select these values.

Keyword: window.location.split

Community
  • 1
  • 1
Bob Dinero
  • 33
  • 2
  • 6

1 Answers1

0

Any example of the page?

Without a sample, I'd suggest doing something like:

$('a').each(function(){
     alert($(this).attr('href'));
});

Would really need to see the structure of your data do me sure where to go with that.

EDIT

You may be talking about getting request parameters ? http://jquery-howto.blogspot.com/2009/09/get-url-parameters-values-with-jquery.html

Has a good tutorial on splitting out the window.location, I'm not sure about grabbing them it they're POSTed.

There's also a question here about reading $_POST how to get GET and POST variables with JQuery?

Community
  • 1
  • 1
Alex C
  • 16,624
  • 18
  • 66
  • 98
  • I modified the post to reason why I am needing to extract url. Please let me know. – Bob Dinero Nov 22 '10 at 20:21
  • Sorry Bob, I followed the link but can't seem to access it from where I'm at. I'll try to answer again - but - I'm still going to have to make some assumptions based on what I can't see. – Alex C Nov 22 '10 at 20:35
  • It's a internal link; so not accessible from outside. But the url looks like that i have posted. Thanks Alex – Bob Dinero Nov 22 '10 at 20:49
  • ahh :) OK ... so did pulling it off the $_GET work like in the questions I linked you to ? – Alex C Nov 22 '10 at 21:02