Bug Tracker

Modify

Ticket #1207 (closed enhancement: wontfix)

Opened 7 years ago

Last modified 2 years ago

URL Parameter Function

Reported by: bgoldman Owned by:
Priority: minor Milestone: 1.1.4
Component: core Version: 1.1.3
Keywords: Cc:
Blocking: Blocked by:

Description

I think this would be a good addition to jQuery core, because most people use or might want to use URL parameters in their Javascript. This function makes it really easy:

//returns the requested GET parameter from the URL
url: function(param) {
    var regex = '[?&]' + param + '=([^&#]*)';
    var results = (new RegExp(regex)).exec(window.location.href);
    if(results) return results[1];
    return '';
}

Change History

comment:1 Changed 7 years ago by john

  • Status changed from new to closed
  • Version changed from 1.1.2 to 1.1.3
  • Resolution set to wontfix
  • Milestone changed from 1.1.3 to 1.1.4

We're currently not planning on adding this to core - however this would make for a fantastic plugin :-)

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.