Apr 21 2007

jQuery-Plugin - getUrlParam (version 2)

veröffentlicht von Mathias Bank. Abgelegt unter: jQuery

Some time ago, I have written a small jQuery plugin to easily get GET-Variables. The plugin is used by a lot of people. But it doesn’t satisfy all possibilities, you need.

Today, I have rewritten the plugin. It is now able to:

  • Parse GET parameters of the document
  • Parse image or JavaScript links with the help of the ID

The last method helps you to clearly separate html/php and JavaScript. I need it, because my php script is generating a special value. Now, I want to use this value in JavaScript, but I don’t want to write the value to my html-page (clear unobtrusive JavaScript). So I include the JavaScript file like this:

With this plugin, it is very easy to get the value of param ajaxUrl.

Have fun! Here is the source.

[Update]
The plugin is now able to handle href attributes, too. It checks now

  • if you want a document parameter
  • or there is a src attribute
  • or there is a href attribute
  • else it returns null

1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...
^

Bisher 76 Reaktionen

  1. Alexandre Plennevauxon 7. Mai 2007 at 15:55

    hello!

    very nice !

    i owuld like to suggest a tweak:

    i need to find the value of a parameter of the src attribute of my A tag. unfortunately, that does not work
    $(”a.ajax”)).getURLParam(”todo”);

    could you make that mod ?

    thanks!!

  2. Mathias Bankon 7. Mai 2007 at 16:12

    Yes, there is a new version (2.1) for this mod.

  3. Alexandre Plennevauxon 7. Mai 2007 at 16:19

    hello Mathias,

    where can i find it ? i only find version 2. not 2.1. Am i being silly ?

  4. Mathias Bankon 7. Mai 2007 at 16:23

    I have replaced the old version. Perhaps, you get a cached version.

  5. Alexandre Plennevauxon 7. Mai 2007 at 16:34

    indeed, thank you very much!

  6. Peter Kenton 29. Mai 2007 at 10:03

    Hallo Mathias, du scheinst ziemlich viel mit jQuery zu machen. Konnte leider keinen Link finden wie man mit dir Kontakt aufnehmen kann?
    Weißt du wie man bei Klick auf einen Link einen Container neu laden kann bzw. Inhalt von einer bestimmten URL in einem Container laden kann?

    Gruß,
    Peter

  7. Mathias Bankon 29. Mai 2007 at 10:13

    Hallo Peter,

    meine Lieblings-Referenz findest du unter Visual jQuery. Um auf den Klick zu reagieren brauchst du:

    
    $('#deinLinkID').click(function() {...});
    

    Und um Daten von einer URL zu holen z.B.

    
    $.get(...);
    

    Zum setzen eines Conainer-Inhalts

    
    $('#deinContainer').html(htmlCode);
    

    Falls du weitere Unterstützung brauchst, kann ich dir die deutsche Community Strohhalm.org - Community for Webworkers empfehlen, da sind auch ein paar jQuery-Benutzer dabei.

    Gruß

    Mathias

  8. Viorel Stirbuon 25. Juni 2007 at 13:14

    You should use de/encodeURIComponent instead of un/escape. Also the values (just the keys) are not decoded. For details about encodings check this page :
    http://xkr.us/articles/javascript/encode-compare/

  9. Viorel Stirbuon 25. Juni 2007 at 13:58

    Also none of the decode functions (that i know of) translate + to space. So here are the changed lines :

    var val = decodeURIComponent( qString[i].split("=")[1].replace(/\+/g,' ') );
    returnVal.push(val);

  10. Timon 29. Juni 2007 at 9:00

    Hi Mathias,
    I’m rather new at Javascript and jQuery. I was wondering if you could awnser my question.

    Im Using this script.

    function mycarousel_itemFirstInCallback(carousel, item, idx, state)
    {
    if (state == ‘init’)
    carousel.scroll(1, false);
    };

    As you can see i’m using jCarousel. The number in this string carousel.scroll(1, false);
    is the id of a slide in the carousel. If I click on a link somewhere then I send this id with the link.
    For example:

    index.php?id=2

    How do I get the id that I send into this carousel.scroll(MY ID, false);
    I’m sorry Im a bit of a noob at javascript. I hope you can help me!

    Greetz Tim

  11. Mathias Bankon 29. Juni 2007 at 9:16

    Well, that’s quite easy. If you call the function within the onclick-handler, you can get your id with


    $(this).getUrlParam("id");

    If “this” is not your link, you have to set an id in your link:


    <a href="bla?id=2" id="myLink" />

    Than, you can use:


    $('#myLink').getUrlParam("id");

  12. Timon 29. Juni 2007 at 10:08

    Hi Mathias,

    Thanks for the quick reply!
    I understand the way you explain it, but how do I integrate it into the code…

    This is what I have:

    if (state == ‘init’)
    carousel.scroll(1, false);

    Does it become this?

    id = $(’#myLink’).getUrlParam(”id”);

    if (state == ‘init’)
    carousel.scroll(’ + id + ‘, false);

    Thanks man!
    Tim

  13. Mathias Bankon 29. Juni 2007 at 12:41

    No, just use


    carousel.scroll(id, false);

  14. Timon 29. Juni 2007 at 12:58

    Sorry to bother you again ;-)

    Where do I put this:
    $(’#myLink’).getUrlParam(”id”);

    If I use this:
    carousel.scroll(id, false);

  15. Matthewon 27. August 2007 at 19:12

    Hi,

    I tried to compress your plug-in using the same site jquery uses (url –> dean.edwards.name/packer/) and found that your plug-in is missing a couple of semi-colons.

    Thus I’ve modified two lines…

    before:
    var strHref = $(this).attr(”src”)
    after:
    var strHref = $(this).attr(”src”);

    before:
    var strHref = $(this).attr(”href”)
    after:
    var strHref = $(this).attr(”href”);

    Now it works compacted.

  16. Massimiliano Balestrierion 3. Oktober 2007 at 9:15

    this can be util…
    jQuery.fn.extend({
    getAnchor: function(){
    if(window.location.href.indexOf(”#”) != -1){
    var url = window.location.href;
    var uanchor = window.location.href.split(”#”);
    if(uanchor[1]){
    return uanchor[1];
    }
    }
    }
    });

  17. […] Mathias Bank, der Entwickler des jQuery-Plugins getUrlParam, beschreibt unter dem Titel “Eevent driven programming with jQuery eine interessante Möglichkeit, mit jQuery Funktionen dynamisch an Ereignisse zu binden. […]

  18. Patrick Mézardon 12. Dezember 2007 at 11:41

    Hello,

    1- I find getParam() returning a string or an array of strings depending on the input URL a bit inconvenient, the caller has to expect boths. What about always returning arrays (empty, with a single value or with multiple values) ? or have another version returning only null or a string, taking the first occurence of the given parameter ?

    2- What about decoding the values ? Do we really want to get “foo%20bar” instead of “foo bar” ? Can we at least make that an optional parameter ?

    Thanks for this plugin !

  19. Mathiason 12. Dezember 2007 at 11:54

    Hello,

    1- well: As a developer, you should know, which parameter is an array and which is not. Of course, it would be possible to always return an array. But this does not make sense. You know, what you expect.

    2- that’s a good idea. It will be included in the next version.

  20. Patrick Mézardon 12. Dezember 2007 at 14:01

    > As a developer, you should know, which parameter is an array and which is not.

    Exactly and that’s why I am the one who decides to call either getAllParams() or getSingleParam(), and not let getParam() decide for me depending on *external input*. Since I know how I want these parameters to be processed, let getParam() give me what I asked for.

  21. Alexandre Plennevauxon 4. Januar 2008 at 18:11

    please note that there is an error in your plugin code or a possible change since jquery.1.2.2b

    if ($(this).attr(”src”) != “undefined”) {

    does not work. It needs to be

    if ($(this).attr(”src”)) {

    same for the other IF conditions.

    HTH,

    alexandre

  22. […] <html> <title>Test</title> <head> <script src="/js/jquery.js" type="text/javascript"></script> <script src="/js/jquery.getUrlParam.js" type="text/javascript"></script> <script type="text/javascript"> jQuery().ready(function() { $("#irgendwas a").click(function() { var test = $(this).getUrlParam(’vorname’); alert(test); return false; }); }); </script> </head> <body> <div id="irgendwas"><a href="test.pl?vorname=max&amp;nachname=mustermann">Hier klicken</a></div> </body> </html> Hier ist der Link zu getUrlParam(): Mathias Bank jQuery-Plugin - getUrlParam (version 2) […]

  23. kostason 25. Januar 2008 at 18:07

    a little bit changed to support getting the params of a child frame. for use with iframes .

    //frm is the frame for which you want to examine the params
    getUrlParam: function(strParamName, frm){
    strParamName = escape(unescape(strParamName));

    var returnVal = new Array();
    var qString = null;

    if ($(this).attr(”nodeName”)==”#document”) {
    //document-handler

    var loca;
    if(frm){
    loca = frm.location;
    }else{
    loca = window.location;
    }

    if (loca.search.search(strParamName) > -1 ){

    qString = loca.search.substr(1,window.location.search.length).split(”&”);
    }

  24. Michaelon 12. April 2008 at 18:13

    Hallo Matthias,

    bin gerade auf dein Plugin gestossen. Vielen Dank für die Veröffentlichung!

    Anbei eine kürzere Implementierung Deiner Funktion. Wenn Du sie gut findest, kannst Du vielleicht Teile übernehmen, bevor es noch eine weiteres Plugin gibt :)

    Die Funktion basiert auf einem Kommentar von Eli zu deiner ersten Version, dessen Code bei mir jedoch nicht funktionierte. Aus Performancegründen wird der querystring übergeben und nicht über Selektoren nach #document, src oder href gesucht.

    BTW, was bewirkt die Anweisung strParamName = escape(unescape(strParamName)); in Deinem Plugin?
    Heben sich escape und unescape nicht auf?

    $.getUrlParam = function(paramname, querystr){

    querystr = (querystr == undefined) ? window.location.search : querystr;
    // regexp escape paramname
    paramname = paramname.replace(/\\|\^|\$|\*|\+|\?|\.|\(|\)|\[|\]/g, “\\$&”);
    // build regexp
    var pattern = new RegExp(”(.*)(” + paramname + “=)([^&#]*)(.*)”,”i”);
    var result = pattern.exec(querystr)
    if(result == null) {
    // param not found - returns null to distinguish if the param contains no value and therefore returns an empty string
    return null;
    } else {
    return unescape(result[3]);
    }
    } // end function getUrlParam

  25. Mathias Bankon 15. April 2008 at 19:08

    Heben sich escape und unescape nicht auf?

    Das hatte ich damals auch gedacht, aber aus irgendeinem Grund hatte ich es dann doch drin gelassen, weil es ein Problem gelöst hatte. Frag mich jetzt aber nicht, was das war. Sollte doch mehr dokumentieren *hrmpf*

  26. […] forms. FormEXCELLENT Change HTML forms to submit via Ajax. Gallery Viewer JavaScript image gallery. getUrlParam Function to get url parameters. Google Feed Plugin Display any RSS feed to a webpage. Gradient Adds […]

  27. Richard Ogimaon 14. Juni 2008 at 23:27

    Hey thanks for your work that you put into this site design.

    Richard Ogima

  28. Peter Benoiton 19. Juni 2008 at 19:23

    Been looking for something like this for a long time, excellent work!

    -Pete

  29. paulon 7. August 2008 at 20:00

    I’m trying to pass a url as a param and this url contains characters which is causing it to lose data from the string. Is there a way around this?

    For example, the url string i’m attempting to pass is:

    http://some.website.com/somePage.aspx?u=other.website.com&lo=1

    When i alert the value of qString i get:

    http://some.website.com/somePage.aspx?u

  30. […] forms. FormEXCELLENT Change HTML forms to submit via Ajax. Gallery Viewer JavaScript image gallery. getUrlParam Function to get url parameters. Google Feed Plugin Display any RSS feed to a webpage. Gradient Adds […]

  31. somelon 7. September 2008 at 4:13

    Hi,
    Thats g8. But I have a script like this “”

    If any one paste this code to his or her website then some server information will be loaded on that website from me. But problem is i want to catch param value ‘com_id’ from my script. I used the getUrlParam plugin on the same js file ‘widget_job_board.js’ but an error occurs like this “$(”#script1″) has no properties” . Would u like to help me Mathias.

  32. Mathias Bankon 7. September 2008 at 6:43

    Well, there is no code, which can be seen, but I think, that your included script file has no id. You have to include the file with an id.

  33. Kaion 26. November 2008 at 9:39

    Cool and useful script. Although you should wrap the plugin like this (taken from here: http://docs.jquery.com/Plugins/Authoring):

    (function($) {
    // plugin code here, use $ as much as you like
    })(jQuery);

    It’s a minor inconvenience for the user to wrap it, if they want/need to use aliases, but I guess it wouldn’t hurt to provide it wrapped :)

    Thanks for a great script!

  34. Paul Houleon 27. Februar 2009 at 16:12

    This is a useful function, but I note that it doesn’t urldecode parameters, so I need to do an extra step every time I want to process a parameter.

    Adding urldecoding to getUrlParam would be a breaking change, but it would be nice to add a function that has urlencode built in… Otherwise (i) I have to write it, and (ii) newbs are going to write programs that get confused about “+” and space.

  35. Mathias Bankon 28. Februar 2009 at 11:08

    Well, there have been many good ideas since the second version. I my next free time, I will write the a new version, which will be capable of your comments.

    Unfortunatelly, that can take some time, because currently I’m very busy.

  36. Douglas Burchardon 6. März 2009 at 8:19

    I ran into the same problem as Matthewon reported on 2007-08-27. Lines 40 and 47 are missing their trailing semicolons. The library works fine as is, but when minified the library breaks (doesn’t work). I added those two missing semicolons, and everything works fine after minification.

  37. Victoron 11. März 2009 at 12:10

    Hi… I’m using your great code for validation routines in a web application. I did a little change to your code for support non english characters (our system are in spanish), using unescape function.

    (lines 60-65)

    for (var i=0;i<qString.length; i++){
    if (escape(unescape(qString[i].split(”=”)[0])) == strParamName){
    returnVal.push(unescape(qString[i].split(”=”)[1]));
    }
    }

    Great work

  38. Marioon 12. März 2009 at 12:36

    I’ve made some changes to the getUrlParam script, it still works in the same way but you can now query more than one element at a time:

    jQuery.fn.extend({
    getUrlParam: function(strParamName){
    strParamName = escape(unescape(strParamName));
    var returnVal = new Array();
    this.each(

    function()
    {
    var strHref = $(this).attr(”src”)|| $(this).attr(”href”)|| this.URL||”";
    var qString = “”;

    if ( strHref.search(”#|\\?”) > -1 ){
    var strQueryString = strHref.substr(strHref.search(”#|\\?”)+1);
    qString = strQueryString.split(”&”);
    }

    for (var i=0;i<qString.length; i++){
    if (escape(unescape(qString[i].split(”=”)[0])) == strParamName){
    returnVal.push(qString[i].split(”=”)[1]);
    }
    }
    }
    );

    if (returnVal.length==0) return null;
    else if (returnVal.length==1) return returnVal[0];
    else return returnVal;
    }
    });

  39. Marioon 12. März 2009 at 12:38

    Oh yes and use # or ?

  40. […] to http://www.mathias-bank.de/2007/04/21/jquery-plugin-geturlparam-version-2/ for more […]

  41. andrea djunaidyon 25. April 2009 at 5:22

    thks a bunch! keep up the good work!

  42. Internetagenturon 29. April 2009 at 11:48

    Thanks and that tutorial has me very helped.

  43. […] jQuery GetURLParam plugin […]

  44. […] didn’t take me long to write it, because I embedded both jQuery and the getUrlParam jQuery plugin by Mathias Bank. This made it simple to create Bing Numbered Search Results. In the end, it took […]

  45. WAGIIon 22. Juni 2009 at 12:35

    Hi Mathias,
    erst einmal: nettes Plugin. Hat mir sehr geholfen. Leider bin ich auf ein Problem gestoßen, wozu mir gerade keine Lösung einfällt. Wie greife ich denn auf sowas hier zu:

    alert($(document).getUrlParam(’tx_mytestshop_pi1[catId]’));

    Hintergrund: TYPO3-Extensions erzeugen immer solche Parameterarrays in den URLs. Ich müsste auf den Wert von catId zugreifen…

  46. Webagenturon 22. Juni 2009 at 13:04

    Das mit Typo3 und den Extensions würde mich auch mal interessieren, zumal ich sehr viel JQUERY in meinen Typo3-Projekten einsetze.

  47. WAGIIon 22. Juni 2009 at 16:25

    Nachtrag:
    Ich habe jetzt stattdessen jqURL genommen. Das funktioniert auch mit o.g. Problematik.

  48. Chrison 7. Juli 2009 at 21:54

    I love this extension, thanks for posting it,

    I did however run into an issue, when I used it on an “a” tag, it always bombed because it did not pass over the “src” attr check.

    I was able to fix this by changing the lines

    } else if ($(this).attr(”src”) != “undefined”) {
    } else if ($(this).attr(”href”) != “undefined”) {

    to

    } else if (typeof $(this).attr(”src”) != “undefined”) {
    } else if (typeof $(this).attr(”href”) != “undefined”) {

    … though, I was only using FF3 for the Mac.

  49. Stephenon 3. August 2009 at 13:54

    Great stuff, thanks for making it available

    Will probably use this over and over again! ;)

  50. teh_hahnon 12. August 2009 at 11:51

    Zuerst einmal: Schönes PlugIn! Mir stellt sich allerdings ein Problem (ich denke ziemlich einfach zu lösen, oder einfach mit diesem PlugIn nicht möglich):

    Ich entwickle eine Seite, die Inhalte mittels AJAX lädt (sprich: FrontEnd besteht aus Navigation und Header und das BackEnd lädt je nach übermittelten GET-Parametern Inhalte dynamisch nach - natürlich angestoßen durch JavaScripts). Da das DOM natürlich schon beim Laden des FrontEnds “ready” ist, muss ich manche JavaScripts im BackEnd “nachladen” (nach der Ausgabe, damit sichergestellt ist, dass alles im DOM steht). Hier lade ich auch ein Skript nach, dass dieses PlugIn verwenden soll (und das PlugIn zuvor selbst). Wenn ich nun versuche GET-Parameter auszulesen bekomme ich immer null zurück. Ich denke das liegt daran, dass dieses PlugIn versucht die Parameter vom FrontEnd zu bekommen, nicht jedoch vom BackEnd. Ich bräuchte also eine explizite Möglichkeit auf die GET-Parameter eines bestimmten PHP-Skriptes zuzugreifen (in meinem Fall: “loader.php”).

  51. Mathias Bankon 12. August 2009 at 12:31

    @teh_han: Verstehe ehrlich gesagt das Problem nicht: du schickt an den Server eine Anfrage mit GET-Parameter und willst die dann mit diesem Plugin auf dem Client auslesen? Dann weißt du doch die Anfrage schon. Müsste ich mal sehen, was du meinst. Oder verwechselst du jetzt serverseitige Programmierung mit clientseitiger?

    Für jQuery kann ich dir http://www.strohhalm.org empfehlen. Da sind ein paar (ich inkl.), die sich mit jQuery auskennen und dir sicherlich - auch mit diesem Plugin - helfen können.

  52. Alex Dahlemon 17. August 2009 at 16:57

    Hallo,

    ich wollte nur ein kurzes Dankeschön für das Plugin dalassen… hat mir eine Menge Arbeit erspart. Und mit dem in den Kommentaren angegebenen if-fix läuft es wirklich richtig gut!!

  53. Gordieon 31. August 2009 at 1:50

    Hi had problems with your scripts for some reasons, this is what for me :

    -replaced : all “$” by “jQuery”

    -replaced :

    } else if (jQuery(this).attr(”src”)!=”undefined”) {

    by

    } else if (jQuery(this).attr(”src”)) {

    -replaced :

    } else if (jQuery(this).attr(”href”)!=”undefined”) {

    by :

    } else if (jQuery(this).attr(”href”)) {

  54. […] getUrlParam Function to get url parameters. […]

  55. Jader Diason 21. Oktober 2009 at 15:50

    You are not handling parameters with “=” well:

    Instead of:

    for (var i=0;i<qString.length; i++){
    if (escape(unescape(qString[i].split(”=”)[0])) == strParamName){
    returnVal.push(qString[i].split(”=”)[1]);
    }

    }

    You should:

    for (var i = 0; i = 0) &&
    (escape(unescape(qString[i].substr(0, index))) == strParamName)) {
    returnVal.push(qString[i].substr(index + 1));
    }
    }

  56. Jader Diason 21. Oktober 2009 at 15:52

    My code was altered some way when I submitted. Let’s try again:

    for (var i = 0; i = 0) &&
    (escape(unescape(qString[i].substr(0, index))) == strParamName)) {
    returnVal.push(qString[i].substr(index + 1));
    }
    }

  57. Jader Diason 21. Oktober 2009 at 16:12

    I don’t know the syntax to post code here so I published the corrected version of your code at
    http://code.google.com/p/get-query-string-jquery-plugin/source/browse/trunk/jquery.getUrlParam.js

  58. qlimaxon 3. November 2009 at 22:52

    thanks for your job!

  59. […] didn’t take me long to write it, because I embedded both jQuery and the getUrlParam jQuery plugin by Mathias Bank. This made it simple to create Bing Numbered Search Results. In the end, it took […]

  60. Michael Fritzon 9. Dezember 2009 at 13:16

    I’ve got some improvements to have those parameters case insensitive, because php does not use case sensitive url params.

    -strParamName = escape(unescape(strParamName));
    +strParamName = escape(unescape(strParamName)).toLowerCase();

    -if (window.location.search.search(strParamName) > -1 ){
    -qString = window.location.search.substr(1,window.location.search.length).split(”&”);
    +if (window.location.search.toLowerCase().search(strParamName) > -1 ){
    +qString = window.location.search.toLowerCase().substr(1,window.location.search.length).split(”&”);

  61. […] getUrlParam Function to get url parameters. […]

  62. […] getUrlParam Function to get url parameters. […]

  63. […] getUrlParam Function to get url parameters. […]

  64. […] getUrlParam Function to get url parameters. […]

  65. John Griffithson 25. Februar 2010 at 0:17

    Hiya,

    cleaned up your plugin, ran it thru JSLint and compacted with Google Closure compiler

    posted here,

    http://github.com/johnantoni/jquery.geturlparam

    good work btw.

  66. Dorian Collieron 4. März 2010 at 10:27

    This is great. I look forward to using it in one of my projects.

    Thanks

  67. Aram Mäkivierikkoon 12. März 2010 at 11:43

    Hi! Great plugin!

    I have hrefs that end with an anchor (i.e. href=”?param1=value&param2=value2#anchorName”)

    Currently, if I ask for param2, i get ‘value2#anchorName’. To fix this, instead of using

    returnVal.push(qString[i].split(”=”)[1]);

    you could strip the trailing anchor name:

    var paramValue = qString[i].split(”=”)[1];
    returnVal.push(paramValue.substr(0, paramValue.indexOf(”#”)));

    also, chekcing for “undefined” as a string doesn’t work:
    if ($(this).attr(”src”) != “undefined”)
    if ($(this).attr(”href”) != “undefined”)
    you need to remove the quotes from ‘undefined’:
    if ($(this).attr(”src”) != undefined)
    if ($(this).attr(”href”) != undefined)

  68. […] getUrlParam Function to get url parameters. […]

  69. […] getUrlParam Function to get url parameters. […]

  70. Christophon 9. Juni 2010 at 17:40

    Hi Mathias,

    Super Seite wirklich spitze und ich hab andscheinend wirklich auch noch das Plugin gefunden was ich brauch/te… ;) *happy*

    Aber hätte da noch eine Frage… Wie ist es möglich aus der URL nur den letzten verweiß rauszufiltern, nach “/”
    mal beispiel damit Du weißt was ich meine…
    z.b.
    http://www.mathias-bank.de/2007/04/21/— AB HIER>jquery-plugin-geturlparam-version-2/

    ich hab es bis jetzt so gelöst das ich immer die ganze URL abgefragt habe mit document.URL das ist aber irgendwie nicht “richtig” funktioniert aber bei manchen browsern ;)

    Bin da totaler Anfänger und würde mich über hilfe freuen…

    Mit freundlichem Gruß

    Christoph

  71. […] getUrlParam […]

  72. Dannielon 26. August 2010 at 23:44

    Hi Mathias,

    Sorry but I am quite new to this.

    I am trying to use your plugin to capture a query in a url. What I want to do is capture that single query (cp) and enter just the 999 in text input box.

    the url string: mysite.com/test.aspx?ID=1194&cp=999

    could you possibly give me some guidance on how to do this?

    Regards

  73. Michael Fritzon 27. August 2010 at 8:30

    var cp = $(document).getUrlParam(’cp’);

  74. Mathias Bankon 27. August 2010 at 8:46

    Yes, absolutely correct. That should do what you want. Thanks @Michael

  75. Dannielon 27. August 2010 at 8:55

    Thanks Michael, that worked great.

  76. Dannielon 27. August 2010 at 9:06

    I know this is probably a very simple solution, but just incase anyone else out there is looking for a similar answer here it this thanks to Michael…

    var cp = $(document).getUrlParam(’cp’);
    $(’input’).attr(’value’, cp)

Trackback URI | Comments RSS

Die Klowand wartet auf dich! Beschreib sie!