Advertisement
Advertisement
| 04.05.2008 at 01:42AM PDT, ID: 23298090 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: |
<html>
<head>
<script language="JavaScript"><!--
function testwithparm( _val1, _val2 )
{
alert( 'val1=' + _val1 );
alert( "val2=" + _val2 );
}
function testnoparm()
{
alert("Hello World!");
alert("I have no parameters!");
}
function cloneFunctionToString( _func )
{
// Find first the whole function string:
var functionString = _func.toString();
// Extract the function body:
var bodyString = functionString.substring( functionString.indexOf("{")+1, functionString.lastIndexOf("}") );
// Extract the function argument:
var functionArg = functionString.substring( functionString.indexOf("(")+1, functionString.indexOf(")") );
// Build an array containing all function arguments:
var argArray = functionArg.split(",");
// Start building the cloning string:
var retString = "new Function(";
// Add paramters to cloning string:
for ( var i = 0; i < argArray.length; i++ )
{
retString += "'" + argArray[i] + "',";
}
// Add function body to cloning string:
retString += "'" + bodyString + "')";
// The function body contains unwanted newlines, remove them:
retString = retString.replace(/\n/g," ");
return retString;
}
// Example: Function with parameters cloned:
var testwithparmCloned = eval( cloneFunctionToString( testwithparm ) );
// Example: Function without parameters cloned:
var testnoparmCloned = eval( cloneFunctionToString( testnoparm ) );
//--></script>
</head>
<body onLoad="testwithparmCloned('Hello','World'); testnoparmCloned();">
</body>
</html>
|
| Microsoft |
| Apple |
| Internet |
| Gamers |
| Digital Living |
| Virus & Spyware |
| Hardware |
| Software |
| ITPro |
| Developer |
| Storage |
| OS |
| Database |
| Security |
| Programming |
| Web Development |
| Networking |
| Other |
| Community Support |
| 04.05.2008 at 03:00AM PDT, ID: 21287601 |
| 04.05.2008 at 03:06AM PDT, ID: 21287607 |
| 04.05.2008 at 03:15AM PDT, ID: 21287620 |
| 04.05.2008 at 03:19AM PDT, ID: 21287631 |
| 04.05.2008 at 05:36AM PDT, ID: 21287912 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: |
function cloneFunction( funcName )
{
// Find first the whole function string. This can even be in another frame:
eval (" var functionString = " + funcName + ".toString();");
// Extract the function body - everything from the first "(" to the end :
var bodyString = functionString.subst( functionString.indexOf("("));
// Add declaration bits and return. Note name of new function will be funcNameCloned:
return "var " + funcName + "Cloned = function " + bodyString;
}
|
| 04.05.2008 at 05:38AM PDT, ID: 21287914 |
| 04.05.2008 at 06:40AM PDT, ID: 21288146 |
| 04.05.2008 at 09:22AM PDT, ID: 21288635 |
| 04.05.2008 at 11:11AM PDT, ID: 21289044 |
| 04.05.2008 at 12:25PM PDT, ID: 21289295 |