JScript

JScript is Microsoft's dialect of the ECMAScript standard that is used in Microsoft's Internet Explorer. JScript is implemented as an Active Scripting engine, so it can be "plugged in" to OLE Automation applications that support Active Scripting, such as Internet Explorer, Active Server Pages, and Windows Script Host. It also means such applications can use multiple Active Scripting languages, e.g., JScript, VBScript or PerlScript.

Share tech news, updates, or what's on your mind.

Sign up to Post

I'm trying to pass props from Parent ("Section") element to all Children elements while trying to make sure that only "Block" elements can be used as children. It works fine when I use React.cloneElement the following way:
const Blocks = React.Children.map(children, child => {
      return React.cloneElement(child, {
        type: this.props.type,
      });
    });

Open in new window


But when add the validation the following way:

const Blocks = React.Children.map(children, child => {
      if (child instanceof Block) {
        return React.cloneElement(child, {
          ...this.props,
        });
      } else {
        console.log('not a block');
        console.log(child);
      }
    });

Open in new window


No content shows up at all. But when I use the validation code the following way:

const Blocks = React.Children.map(children, child => {
      if (child instanceof Block) {
        return React.cloneElement(child, {
          ...this.props,
        });
      } else {
        console.log('not a block');
        console.log(child);
      }
    });

Open in new window


But when I do it the following way, all elements show up double/twice:

const Blocks = React.Children.map(children, child => {
  if (child.type === Block) {
    return React.cloneElement(child, {
      ...this.props,
    });
  } else {
    console.log('not a block');
    console.log(child);
  }
});

Open in new window


As this output image:

double-trouble-cloneElements.JPG
I'm pretty new to this. Not sure what I'm doing wrong here. Any help on this will be appreciated. Thanx.
0
Introduction to Web Design
LVL 13
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

Experts,
 We have requirement to formatting sharepoint 2013 list view header and footer with client side code. We would like to have change OOB paging. Ca you please help with me with some code to change formatting with client side rendering.

After.PNG
Thank You
0
I am new to react js. I am working on a sorting function. Below is my code. When it run the line of :   manList:  newManList.sort( (a, b) => (, I got an error that : The sort method cannot be invoked on an Immutable data structure.  How can I make the newManList variable as a mutable data structure?

Thanks


isHeaderClickable(key){
    let newManList = this.props.mans;
    this.setState({
        manList:  newManList.sort( (a, b) => (
            this.state.direction[key] === 'asc'
                //? parseFloat(a[key]) - parseFloat(b[key])
               // : parseFloat(b[key]) - parseFloat(a[key])
                ? (a[key]) - (b[key])
                : (b[key]) - (a[key])
               )),
        direction: {
            [key]: this.state.direction[key] === 'asc' ? 'desc' : 'asc'
        }

    })

    },
0
Oh men,
Im wondering if you guys can give me some advice and examples of how i can position my web page in the proper manner,
some tricks or best practices for positioning my page locally
regards
0
I tried to create a count down clock in Dreamweaver.  I need to remove the script I entered, but unsure of how to do it.  Help, please.
0
I am trying to get Trend Micro statistics written out to a text file with a batch file.

pccntmon.exe -c >> File.txt
pccntmon.exe -v >> File.txt

I see that the pccntmon.exe app seems to start a new command line when it is executed so only the flags are passed to the exe.  I am sure that this is due to ensuring that the app is not compromised by some easy silly code.  I have many servers over Win 2K3 and up to gather this info.  I do not have access to the central admin server.

I have tried the following :
start /wait cmd /c "C:\Program Files\Trend Micro\OfficeScan Client\pccntmon.exe" -c >> C:\<desktop>\file.txt
and
start /B /wait "C:\Program Files\Trend Micro\OfficeScan Client\pccntmon.exe" -c >> C:\<desktop>\file.txt

Open in new window

This opens a new window and displays the agent info in the console only.  
Also, after the pccntmon.exe executes it is expecting a user to hit "Enter" on the keyboard.  I think I can approach this with a bit of  Jscript.

set SendKeys=CScript //nologo //E:JScript "%~F0"

%SendKeys% "start /wait cmd /c "C:\Program Files\Trend Micro\OfficeScan Client\pccntmon.exe" -c >> C:\<desktop>\file.txt"

@end

// JScript section

var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.SendKeys(WScript.Arguments(0));

Open in new window


But I got to get past the first part first.  Any direction is appreciated.
0

JScript

JScript is Microsoft's dialect of the ECMAScript standard that is used in Microsoft's Internet Explorer. JScript is implemented as an Active Scripting engine, so it can be "plugged in" to OLE Automation applications that support Active Scripting, such as Internet Explorer, Active Server Pages, and Windows Script Host. It also means such applications can use multiple Active Scripting languages, e.g., JScript, VBScript or PerlScript.

Related Topics

Top Experts In
JScript
<
Monthly
>

No Top Experts for this time period. Answer questions to earn the title!