About 53 results
Open links in new tab
  1. Passing string parameter in JavaScript function - Stack Overflow

    Aug 12, 2015 · I was trying to pass a string to a JavaScript function. As it's mentioned here - Pass a string parameter in an onclick function I'm using this simple code- <!DOCTYPE html> …

  2. Is there a way to create a function from a string with javascript ...

    Oct 4, 2011 · If you have a function expression that is in string form and you want to make it a function, then you need to include a return statement in the string you pass to new Function. …

  3. How to turn a String into a JavaScript function call?

    Even if you have to store the function name as a string, you can minimize complexity by doing (eval(settings.functionName))(t.parentNode.id); which minimizes the amount of Javascript you …

  4. How to convert a string to an integer in JavaScript?

    It's good practice to always specify the radix as the second argument. In older browsers, if the string started with a 0, it would be interpreted as octal if the radix wasn't specified which took a …

  5. Convert Javascript Object (incl. functions) to String

    Mar 10, 2011 · Hey, Im trying to convert specific javascript objects to a String. So far I'm working with json2.js. As soon as my Object contain functions, those functions are stripped. I need a …

  6. Returning a string in Javascript - Stack Overflow

    Dec 29, 2012 · This is just my solution. I'm still grabbing at straws trying to understand asynch behaviour, but here's what worked:

  7. How do I convert a string to a function reference in JavaScript?

    Sep 16, 2012 · What I want is to pass a function's name as a string and have that be as if I passed a reference to the function.

  8. Javascript string functions? - Stack Overflow

    Jul 17, 2011 · All string will have a length property you can use to check length, but I would just pull a substring: var str = 'abcdefg'; var shortened = str.substr(0,3); Share

  9. How do I check for an empty/undefined/null string in JavaScript?

    As many know, (0 == "") is true in JavaScript, but since 0 is a value and not empty or null, you may want to test for it. The following two functions return true only for undefined, null, …

  10. JavaScript operator similar to SQL "like" - Stack Overflow

    Jul 9, 2016 · how to match a string based on substring, for e.g if str="john edward" then how can I use the function to return true in both cases, like if str contains john => true , if str contains …

Refresh