Go Premium for a chance to win a PS4. Enter to Win

x

Web Languages and Standards

39K

Solutions

30K

Contributors

Web development can range from developing the simplest static single page of plain text to the most complex web-based internet applications, electronic businesses, and social network services using a wide variety of languages and standards, including the familiar HTML, JavaScript and jQuery, ASP and ASP.NET, PHP, ColdFusion, CSS, PHP, Flex and Flash, but also the implementation of a broad list of standards including XML, WSDL, SSDL, VoiceXML and many more.

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

Sign up to Post

hello, here's what i'd like to do:

go to my web page viewer.html
select the dropdown list and choose a video file.
the video then plays on my page viewer.html

a few times a month i FTP videos up to my directory which is www.mysite.com/storage/videos/

my page looks like this so far. please note i'm a complete novice.  i'm hoping someone can finish this off for me. thanks

<h1>hello world</h1>
<p>this is the text</p>

<script>


var elm=document.getElementById('txtfiletoread');
elm.addEventListener('change',function(){  
  var a=this.value.split('\\'); 
  a=a[a.length - 1];
  videoList.push(a);
});


var myVideo=document.getElementById("video1"); 
var videoList=['part_1.mp4','part_2.mp4','part_3.mp4','part_A.mp3','movie_bbb.ogg'];
var index = videoList.indexOf(window.currentVideoName);
//Next button
function nextButton(){
myVideo.pause();
myVideo.currentTime=0;
index = index + 1;
if(index==videoList.length)
index = 0;
alert(videoList[index]);
myVideo.src = 'C:/'+videoList[index];
window.currentVideoName=videoList[index];
myVideo.play();
}
function playPause()
</script>

<div style="text-align:center"> 
  <button onclick="playPause()">Play/Pause</button> 
  <button onclick="nextButton()">Next</button>
  <br> 
  <video id="video1" width="420">
    <source src="C:/sample.mp4" type="video/mp4">
    <source  type="video/mp3">
    <source type="video/ogg">
    Your browser does not support HTML5 video.
  </video>
</div> 

</body>

</html>

Open in new window



my hosting package is apache/php

thank you
0
Free Tool: ZipGrep
LVL 11
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Hi, It looks like our sitemap lists pages which have a canonical tag, like  www dot magickitchen.com/menu/get-well/7601.html.

Is that something not allowed by Google? Will it affect search results? Because the site map generator just adds them in, and I update it every few months. It will take some extra work to list all my pages with canonical tags and remove them from the sitemap each time.

For instance, this is listed five times in different categories, the highlighted one is the canonical page.

Capture.JPG
Thanks, looking forward to your advice!
0
Hi,

I'm trying to install one of today's security updates (KB3162047, Office 2013), and it's failing with Code 780, unknown error. I've tried downloading and manual install with no luck. Anyone have an idea how to troubleshoot this?

Never mind. "Windows Font Cache" service was disabled. Enabling it allowed the update to succeed.
0
When I have a list inside another list it indents too far. Is there a way I can change the indents to stop this from happening or limit how far right the text goes. I've attached a picture of the text and what I have for a list inside another list. Thank you
list-in-list-html.PNG
list-in-list.PNG
0
hi,

This is probably a noddy question as I'm quite new to this.

I want to use FTP to publish files to the public web.

On Bluehost I've setup an ftp account which I can add files to. The details shown by bluehost are:

Login:
username@mydomain.com
Path:
/home4/maydomaincom/mydomain.com/username

How can I get these files to show on my website?

I can login using my domain password and put them into the www folder, but i'd rather not use that account.

Thanks
0
Here i the CSS I use to create the dark corner in the upper-right.


.dog-ear {
	position: absolute;
	top: 0;
	right: 0;
	height: 10px;
	width: 10px;
	background: linear-gradient(45deg, #333 0%, #333 50%, #fff 50%, #fff 100%);
}

Open in new window



But It sometimes looks choppy.

Choppy line
Is there a different way to do this?
0
I added a class to a div, and verify the booelan's working.  But, the ng-class is failing.

    <div ng-class="{ 'dog-ear' : isDogEared }"></div>

Open in new window


Inside the Typescript template I have:
@Output() isDogEared:boolean;

  dogEarIndexes: number[];

  constructor() 
  { 
    this.dogEarIndexes = [ 1,3,5 ];
  }

  ngOnInit() {
    this.imageFilename = "PuzzlePiece_Maps_" + (this.value.id + 1).toString() + ".gif";
    
    this.id = this.value.id;
    this.isDogEared = this.dogEarIndexes.indexOf(this.id) > -1;
    console.log('Id:'+this.id+" - " + this.imageFilename + " isDogEared="+ this.isDogEared.toString());    
  }

Open in new window


and the page does not generate any errors, and I verified the boolean values are properly set in ngOnInit()

Booleans Work OK

What am I missing?
0
I am unsure about how to change the styling on my PuzzlePiece Component. I draw an image inside of a span.

<div class="puzzle-piece">
    <span><img src="{{ imageFilename }}" /></span>
</div>

Open in new window


with the following styling...
.puzzle-piece {
    width: 12.5%;
    float: left;
    box-sizing: border-box;
    background-color: #007acc;
    position: relative;
    padding-bottom: 12.5%;
    border-right: 2px solid blue;
    border-bottom: 2px solid blue;
    text-align: center;
    z-index: 10;
}
.puzzle-piece span {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 3em;
    font-family: 'Arial';
    transform: translateX(-50%) translateY(-50%);
    color: rgba(255,255,255,5);
}

Open in new window


In order to make the edges touch for each of the puzzle pieces, I needed to make the width of the puzzle 100%:
.puzzle {
    width: 100%;
    margin: 0 auto;
    border-top: 2px solid blue;
    border-left: 2px solid blue;
}

Open in new window


But I prefer a lower width, like 80%.

Full screen
Also, I'd like the image to maintain its integrity, and stay tight, even when the browser grows.
centered
Lastly, does the span style control the image style? Or does img need its own styling?
0
Code snippet from PuzzleCanvasComponent where I fill the PuzzlePieceComponent array.
ngOnInit() { 
    let index = 0;
    for(let row = 0; row < this.rows; row++) {
      for(let column = 0; column < this.columns; column++) {
        this.pieces[index] = new PuzzlePieceComponent();
        this.pieces[index].id=index;
        index++;
      }
    }
  }

Open in new window


I want to set the "id" property there, but this line does nothing:
        this.pieces[index].id=index;


So I tried to use the HTML template for PuzzleCanvasComponent, but have the syntax wrong.
<div class="puzzle">
    <puzzle-piece *ngFor="#piece of pieces; #i=index" [value]="piece" [id]="i"></puzzle-piece>
</div>

Open in new window


with the following properties created in the TS file
export class PuzzlePieceComponent implements OnInit {
  @Input() value:PuzzlePieceComponent;
  @Input() id:Number;
...

Open in new window


I'd prefer if the first method could be made to work, especially since I want to expand the number or properties set in
ngOnInit() beyond just the id.

Is method #1 fixable? Or must iI use the second method? If so, what is the syntax?
0
I have a little Angular app with two small Components, PuzzleCanvas and PuzzlePiece. I have a sample number of 9

PuzzlePieceComponent with a style CSS I just can not update. So, as a result, all PuzzlePieceComponents are drawn over the other.
import { Component, OnInit, Input } from '@angular/core';
declare var jquery:any;
declare var $ :any;

@Component({
  selector: 'puzzlepiece',
  styles: [ ],
  template: `
     <img id="#PuzzePiece{{ id }}" 
     style="position:absolute; display:block; width:100px; height:100px; left:12px; top:12px;"
     src="../../../assets/images/PuzzleCompleted_{{ id+1 }}.gif"/>
  `
})


export class PuzzlePieceComponent implements OnInit {
  title = 'Puzzle Piece';
  @Input() data:PuzzlePieceComponent;
  @Input() id:Number;
  //pieceStyling:string=this.getPieceLocation();
  constructor() { }

  ngOnInit() {
    this.id = this.data.id;   
    console.log("ID:" + this.id) 
  }

Open in new window



PuzzleCanvasComponent is constructing the PuzzlePieceComponents correctly
import { Component, Input, OnInit } from '@angular/core';
import { NgFor } from '@angular/common';
import { PuzzlePieceComponent } from '../puzzlepiece/puzzlepiece.component';

@Component({
  selector: 'puzzlecanvas',
  styles: [`canvas { width: 800px; height: 500px; border: 2px solid black; }`],
  template: `<canvas></canvas>
             <puzzlepiece *ngFor="let piece of pieces" [data]="piece" [id]=index></puzzlepiece>`
})

export class PuzzleCanvasComponent implements OnInit {
  title = 'Puzzle Peace';
  @Input() piece:PuzzlePieceComponent;
  pieces = [];
  columns:number = 3;
  rows:number = 3;

  constructor() { }

  ngOnInit() { 
    let index = 0;
    for(let row = 0; row < this.rows; row++) {
      for(let column = 0; column < this.columns; column++) {
        this.pieces[index] = new PuzzlePieceComponent();
        this.pieces[index++].id=index;
      }
    }
  }
}

Open in new window



The PuzzleCanvasComponents are being written one over the other...
Overwriting

But I have verified all 9 PuzzlePieceComponents are loading
Creation
I feel like I have tried everything. Notice I can use the {{}} for property binding when it comes to setting the ID and the src for image.

I have a jquery (Plan B) solutin that also does not work. That question is here:
https://www.experts-exchange.com/questions/29062600/Angular-CSS-need-to-resort-to-jquery.html

It seems like I reached a limiting factor in the Javascript methodology. Is that possible?

Is there a different place in the page life-cycle, besides ngOnInit(), where I can place update logic?

My project is stuck until I can get past this.

Thanks.
0
Free Tool: Subnet Calculator
LVL 11
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

I want to make it easy to run my Angular app so it's easier to show the problem I am having. But I just noticed the repo contains tons of node packages, brining the size of this little Angular program (with two Components) to 172 MB.

I did not want to commit and push this without asking how Plunker works and what options I have regarding all those node modules.

Thanks.
0
Using Angular alone, I have trouble setting the "left" and the "top" for the following image tag. But you can see I am successfully updating  the src value with a variable called "id."

 template: `<img id="#PuzzePiece{{ id }}" style="left:10px; top:10px; position:absolute; width:100px; height:100px;"
                  src="../../../assets/images/PuzzleCompleted_{{ id+1 }}.gif"/>`
})

So I am trying to use jquery with no luck. I am just doing a test, trying to get left and top set to 100. I verified the jquery is correct.

The page thrown no errors so I assume I installed jquery correctly.


  ngOnInit() {
    this.id = this.data.id;    
    this.updateImageCoordinates();
  }

  updateImageCoordinates()
  {
    var imageId = "#PuzzlePiece" + this.id.toString();
    $(imageId).css({"left":100,"top":100});
  }
 
What am I missing?

Thanks
0
when I update this:

constructor()
{
}
 
to be this:

constructor(public _id:Number, public _X:Number, public _Y:Number)
{
}

I get the attached error:

error
and the page fails to load.

Clearly, the declaration of PuzzlePieceComponent in the app.module.ts Module is setting up the expectation for a version with no parameters. How do I et around this?

Are these params needed if I use:

  @Input() id:Number;
  @Input() X:Number;
  @Input() Y:Number;

Thanks.
0
I am successfully setting these values inside the PuzzlePiece component...

  @Input() id:Number;
  @Input() X:Number;
  @Input() Y:Number;

The ID is used to successfully load the correct image file. But I do not know how to draw that image at the X and Y values.

How do I pass a component's value to the CSS?
0
I need to load an image based on a generated filename but find the following logic fails.

@Component({
  selector: 'puzzlepiece',
  styles: [],
  template: '<img src="../../../assets/images/PuzzleCompleted_" + {{ id }} + ".gif" />'
})

Instead of displaying the image, the path name variable is displayed on the page, thusly:

path name
but when I hard code the filename, it works:

@Component({
  selector: 'puzzlepiece',
  styles: [],
  template: '<img src="../../../assets/images/PuzzleCompleted_1.gif" />'
})

hard coded path
How do I use a variable to set the "src" for an image inside an HTML template?
0
I have a PuzzleCanvas component and a PuzzlePiece component. Each PuzzlePiece will persist its location in the matrix of PuzzlePieces.

For example, a PuzzlePiece may be on row 2 of 5 rows and be on column 3 of 8 columns.

How do I transpose this information into the X, Y coordinates for each PuzzlePiece?

Can the PuzzlePiece component use those variables row and column as it calculates where that particular PuzzlePiece should be drawn.

Thanks.
0
I need to create a matrix of child Components inside the parent Component, which creates them. Meanwhile, I need to pass in a few values in init of the child Component, like an Index number and an image filename.

How do I pass in parameters as I create these child Components?

Thanks
0
I have a PuzzleCanvas object and I need it to contain a matrix of PuzzlePieces 8 columns by 5 rows.

I want this done inside the Component itself so that in the HTML for the PuzzleCanvas I can simply use forEach and iterate through a previously created matrix of components.

How do I do this?

Thanks
0
I need to verify I can use automation to create a component, but get errors.

And On the Mac Terminal I also get a new command prompt. is this the CLI?

How do I call up the CLI from terminal?

What's wrong with my

$ ng new component './components/puzzlepiece
The command "new" has an option without the required type and name fields.
Error: The command "new" has an option without the required type and name fields.
    at Class.validateOption (/Users/RA/Documents/Git/PuzzlePeace/node_modules/@angular/cli/ember-cli/lib/models/command.js:377:13)
    at Array.map (<anonymous>)
    at Class.registerOptions (/Users/RA/Documents/Git/PuzzlePeace/node_modules/@angular/cli/ember-cli/lib/models/command.js:163:27)
    at getOptionsTask.run.then (/Users/RA/Documents/Git/PuzzlePeace/node_modules/@angular/cli/commands/new.js:95:18)
    at <anonymous>
$ ng new component './components/puzzlepiece
> pwd


My installation on the Mac looks good, I think:

$ ng -v
    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.4.5
node: 8.6.0
os: darwin x64
@angular/animations: 4.4.4
@angular/common: 4.4.4
@angular/compiler: 4.4.4
@angular/core: 4.4.4
@angular/forms: 4.4.4
0
[Webinar] Cloud and Mobile-First Strategy
LVL 11
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

This makes no sense to me. I created CanvasComponent correctly, I think. I did it manually since the automtation failed me on another questionI posted,

c:\Dev\pp\src\app\app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { CanvasComponent } from './components/canvas/canvas.component';

@NgModule({
  declarations: [
    AppComponent,
    CanvasComponent    
  ],
  imports: [
    BrowserModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Open in new window


c:\Dev\pp\src\app\components\canvas\canvas.component.html
<h1>Hello from the Canvas1</h1>

Open in new window


c:\Dev\pp\src\app\app.component.html
<p>Hello from App</p>
<canvas></canvas>

Open in new window


c:\Dev\pp\src\app\components\canvas\canvas.component.ts
import { Component } from '@angular/core';

@Component({
  selector: 'canvas',
  //templateUrl: './canvas.component.html',
  template: `<h1>Hello from the Canvas2<h1>`
})

export class CanvasComponent {
  title = 'Title';
}

Open in new window



All I get is "Hello from App"

Chrome
Why don't I see?

Hello from the Canvas2

You can see I have commented out:
  //templateUrl: './canvas.component.html',

since that failed also.

Thanks for any help you can provide.

New news...

canvas does show in the debugger...


More new news...

When I place a <br> before <canvas></canvas>
the canvas does not show up on the pages. The same thing happens when I remove:

<p>Hello from the App</>


Lastly, I do see the message in the debugger...

canvas appears on the pageScreen-Shot-2017-10-09-at-11.25.16-P.png
0
I THINK I have a good installation of Node and Angular 4...here's why:

PS C:\dev\pp\src\app\components> ng -v
    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / ? \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.4.5
node: 8.6.0
os: win32 x64
@angular/animations: 4.4.4
@angular/common: 4.4.4
@angular/compiler: 4.4.4
@angular/core: 4.4.4
@angular/forms: 4.4.4
@angular/http: 4.4.4
@angular/platform-browser: 4.4.4
@angular/platform-browser-dynamic: 4.4.4
@angular/router: 4.4.4
@angular/cli: 1.4.5
@angular/compiler-cli: 4.4.4
@angular/language-service: 4.4.4
typescript: 2.3.4
PS C:\dev\pp\src\app\components>

but I can not generate a new component.

PS C:\dev\pp\src\app\components> ng g component [canvas]
The command "generate" has an option without the required type and name fields.
Error: The command "generate" has an option without the required type and name fields.
    at Class.validateOption (C:\dev\pp\node_modules\@angular\cli\ember-cli\lib\models\command.js:377:13)
    at Array.map (<anonymous>)
    at Class.registerOptions (C:\dev\pp\node_modules\@angular\cli\ember-cli\lib\models\command.js:163:27)
    at getOptionsTask.run.then (C:\dev\pp\node_modules\@angular\cli\commands\generate.js:98:18)
    at …
0
Hi all.

I'm playing around with GTM to insert schema.org markup into our product pages.  I've managed to add DOM variables to reference the product's name, description, and URL... but I can't seem to get the product image(s) to reference properly.

I've tried loads of different references (using Inspect Element on our product pages), but can't seem to get it to work.  I've managed to stop it saying "null" to just being blank when viewing the tag in GTM's preview, so I believe I'm on the right track, but I imagine the URL element of schema.org markup should reference the URL of the image?

I've attached a few screenshots.  The variable using div.woocommerce*** returns "", whereas the other one returns "null" at the moment.

Any help is greatly appreciated!

Thanks

Ryan
gtm.PNG
0
When I have the Angular server running, but I'd like to terminate it, must I select Ctr+X?

ng serve
Is this the right way to shut it down? I do not have a command prompt when using PowerShel on Windows

Thanks
0
Beginners pick a language because they think they will make money using language.

But does a student need to start on computer science learning 0's & 1's, trees, lists, stacks, heaps.

Are there some students that are so gifted they can skip to coding the language?

Maybe kids who have used ipads their whole lives can start coding ios without learning about adding machines from the past.

Are there any naturally talented students that dont need to learn computer science theory?
0
I see Typescript can define statically types variable with the word "let"

how do these two lines differ?

let name: string = 'Bob';

name: string = 'Bob';
0

Web Languages and Standards

39K

Solutions

30K

Contributors

Web development can range from developing the simplest static single page of plain text to the most complex web-based internet applications, electronic businesses, and social network services using a wide variety of languages and standards, including the familiar HTML, JavaScript and jQuery, ASP and ASP.NET, PHP, ColdFusion, CSS, PHP, Flex and Flash, but also the implementation of a broad list of standards including XML, WSDL, SSDL, VoiceXML and many more.