Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
I am the chief technical officer at InVision App, Inc - a prototyping and collaboration platform for designers, built by designers. I also rock out in JavaScript and ColdFusion 24x7.
Meanwhile on Twitter
Loading latest tweet...
Ben Nadel at BFusion / BFLEX 2009 (Bloomington, Indiana) with:

Tom

Member since Dec 11, 2008

Recent Blog Comments By Tom

  • Ask Ben: Getting Query String Values In JavaScript

    Posted on Jan 8, 2012 at 4:56 PM

    If you know the parameter you want to skip, in the loop, just put an "if" statement to tell it to do whatever you want for the parameters that are not that one. Say the parameter you want to skip is "ID": var myParam = "ID"; for (var strKey in urlObj) { if (strKey !... read more »

  • Ask Ben: Getting Query String Values In JavaScript

    Posted on Aug 20, 2011 at 12:46 AM

    @Robert, You'd need to decode the characters back out. You could write a function to accept your string and replace the encoded characters with the decoded ones: var myNewString = myOldString.replace('%3A',':'); myNewString = myNewString.replace('+',' '); myNewString = myNewString.replace('%28','... read more »

  • Ask Ben: Getting Query String Values In JavaScript

    Posted on Mar 26, 2010 at 1:43 PM

    And on that eggheadcafe link - it's actually still there, just my period ran into the hyperlink and messed it up. It's: http://www.eggheadcafe.com/articles/20020107.asp . -Tom... read more »

  • Ask Ben: Getting Query String Values In JavaScript

    Posted on Mar 26, 2010 at 1:38 PM

    I saw in the URL string you have at least 3 "&value=" statements. Each item in your URL needs to be unique. You can't have three of the same variable name in the URL string, or the code will default to the last one (the empty value in the URL string). Try changing them to different names and se... read more »

  • Ask Ben: Getting Query String Values In JavaScript

    Posted on May 21, 2009 at 4:15 PM

    To fully answer your question about sending the terms from a URL in an e-mail, you'd be best served by creating a C# web site in ASP .NET through Visual Studio for e-mailing the results out, once you have a page that will change the "window.location.href" address to the website representing your mai... read more »

  • Ask Ben: Getting Query String Values In JavaScript

    Posted on May 21, 2009 at 3:57 PM

    var myOldVariable = displayItem('varInURL'); If you are doing operations on the variable, and want to carry it through to another page when clicking a Submit button, as part of the onclick event for the Submit button, have it called like this: <input type="button" value="Submit" onclick="myPost... read more »

  • Ask Ben: Getting Query String Values In JavaScript

    Posted on Apr 21, 2009 at 6:53 PM

    Well, they removed the page from that eggheadcafe link, so I'll just provide the code. To use this, call displayItem('ItemYouWantFromTheURL') : function PageQuery(q) { if(q.length > 1) this.q = q.substring(1, q.length); else this.q = null; this.keyValuePairs = new Array(); if(q) { for (... read more »

  • Ask Ben: Getting Query String Values In JavaScript

    Posted on Apr 13, 2009 at 9:12 PM

    And for those trying to find a specific parameter and get back a value for it (like the Request.Querystring[""] method in ASP), this is a good site: http://www.eggheadcafe.com/articles/20020107.asp. -Tom... read more »

  • Ask Ben: Getting Query String Values In JavaScript

    Posted on Jun 27, 2008 at 5:03 PM

    Best thing to do is to start off with Ben's complete code, then put in my function, not the other way around. If you replace my s[0] with objUrl[0], and put in your IFRAME tag into the HTML body, that's all there is to it. Test by putting file:\\\C:\folderMyFileIsIn\mypage.htm?url=test.html on you... read more »

  • Ask Ben: Getting Query String Values In JavaScript

    Posted on Jun 27, 2008 at 4:03 PM

    You have it all except for how to get the parsed value. That part was the whole point of this website/page, so I figured you had to have figured that part out already, or at the very least I figured you could have figured out how to use Ben's code to do so (and the numerous posts below it). Don't ... read more »

  • Ask Ben: Getting Query String Values In JavaScript

    Posted on Jun 27, 2008 at 3:24 PM

    Probably 'cause I was wrong... use ID, not name, for your IFRAME tag, then reference it like this: function returnUrlObjVal() { if (s[0]) { var iFrameForm = s[0]; var url = " http://www.url.com/ " + iFrameForm + ".html" myFrame.window.location.href = url; } } ... read more »

  • Ask Ben: Getting Query String Values In JavaScript

    Posted on Jun 27, 2008 at 1:48 PM

    Sorry - in my last comment those "&" should have been "+" since it's JavaScript. "&" are used in VB.... read more »

  • Ask Ben: Getting Query String Values In JavaScript

    Posted on Jun 27, 2008 at 1:45 PM

    Once you get the variable value, give your IFRAME a name tag and a name, and then just put your parameter into a string like: var url = " http://www.url.com/ " & theVariableRepresentingTheUrlParameter & ".htm"; IFRAMEname.src = url; Put that into its own function with the URL parser, then use an o... read more »

  • Ask Ben: Getting Query String Values In JavaScript

    Posted on Jul 31, 2007 at 12:01 PM

    Awesome script! I was able to use your code to pull in a URL that had a variable (mysite.htm?myVariable=value) & pass it to a function easily! (Head script) var urlObj = new Object(); window.location.search.replace( new RegExp( "([^?=&]+)(=([^&]*))?", "g" ), function( $0, $1, $2, $3 ){ ... read more »