Chrome Bug with Knockout?

I have developed a tree view that uses knockout to display a hierarchy. I have noticed a weird situation within chrome that happens when I collapse a node in the tree. The text for the node disappears along with the items under it. I figured I had something wrong with my code and then figured out that it works correctly in both IE and firefox. I created the fiddle below that demonstrates the issue with any extra code from my page stripped out. If you expand a node and then collapse it (the plus button does not change to a minus as it would in my full code), the text disappears. Then, you can just click anywhere on the page to get the text to show back up.

The text that disappears has been outlined in red as recommended in a comment and can be seen in the screenshot

enter image description here

I have tested this out on 4 machines and on each one it doesn’t work when I use Chrome. Is this a bug in Chrome, or am I doing something wrong? Also, can anybody see any way to work around this issue if it is a bug in Chrome?

Example Fiddle

console.clear();

var hierarchyNode = function (parent) {
    var self = this;
    this.name = "Node Name";
    this.hasChildren = ko.observable(true);
    this.childNodes = ko.observableArray();
    this.expanded = ko.observable(false);
};

hierarchyNode.prototype = {
    name: null,
    hasChildren: null,
    childNodes: null,
    getChildNodes: function (element, event) {
        if (element.hasChildren() === true && element.childNodes().length === 0) {
            element.childNodes.push(new hierarchyNode(element));
        }

        element.expanded(!element.expanded());

    }    
};

var hierarchyVM = function () {
    var self = this;

    self.hierarchyNodes = ko.observableArray();
    self.selectItem = function () {};
};

var vm = new hierarchyVM();

vm.hierarchyNodes.push(new hierarchyNode(null));

console.log(vm.hierarchyNodes()[0]);
ko.applyBindings(vm);

read more

Chrome Bug with Knockout?

I have developed a tree view that uses knockout to display a hierarchy. I have noticed a weird situation within chrome that happens when I collapse a node in the tree. The text for the node disappears along with the items under it. I figured I had something wrong with my code and then figured out that it works correctly in both IE and firefox. I created the fiddle below that demonstrates the issue with any extra code from my page stripped out. If you expand a node and then collapse it (the plus button does not change to a minus as it would in my full code), the text disappears. Then, you can just click anywhere on the page to get the text to show back up.

The text that disappears has been outlined in red as recommended in a comment and can be seen in the screenshot

enter image description here

I have tested this out on 4 machines and on each one it doesn’t work when I use Chrome. Is this a bug in Chrome, or am I doing something wrong? Also, can anybody see any way to work around this issue if it is a bug in Chrome?

Example Fiddle

console.clear();

var hierarchyNode = function (parent) {
    var self = this;
    this.name = "Node Name";
    this.hasChildren = ko.observable(true);
    this.childNodes = ko.observableArray();
    this.expanded = ko.observable(false);
};

hierarchyNode.prototype = {
    name: null,
    hasChildren: null,
    childNodes: null,
    getChildNodes: function (element, event) {
        if (element.hasChildren() === true && element.childNodes().length === 0) {
            element.childNodes.push(new hierarchyNode(element));
        }

        element.expanded(!element.expanded());

    }    
};

var hierarchyVM = function () {
    var self = this;

    self.hierarchyNodes = ko.observableArray();
    self.selectItem = function () {};
};

var vm = new hierarchyVM();

vm.hierarchyNodes.push(new hierarchyNode(null));

console.log(vm.hierarchyNodes()[0]);
ko.applyBindings(vm);

read more

PHP Not uploading submitted data to the db

I’m fairly sure I’ve only made a simple mistake, yet I am having troubles finding it. Basically, whenever someone fills in a normal form, the data they enter is submitted to the db table, to be later posted on another page of the site. However, that does not seem to be working.

If possible, I’d just like some help in the right direction about what I’ve actually done wrong.

Thanks in advance, I hope this post isn’t too annoying. I’m new here :,)

PHP:

<?php session_start(); include_once("connection.php"); if(isset($_POST['post'])) { $match_name = strip_tags($_POST['match_name']); $team1 = strip_tags($_POST['team1']); $player1 = strip_tags($_POST['player1']); $player2 = strip_tags($_POST['player2']); $player3 = strip_tags($_POST['player3']); $player4 = strip_tags($_POST['player4']); $player5 = strip_tags($_POST['player5']); $team2 = strip_tags($_POST['team2']); $player6 = strip_tags($_POST['player6']); $player7 = strip_tags($_POST['player7']); $player8 = strip_tags($_POST['player8']); $player9 = strip_tags($_POST['player9']); $player10 = strip_tags($_POST['player10']); $match_name = mysqli_real_escape_string($dbCon, $match_name); $team1 = mysqli_real_escape_string($dbCon, $team1); $player1 = mysqli_real_escape_string($dbCon, $player1); $player2 = mysqli_real_escape_string($dbCon, $player2); $player3 = mysqli_real_escape_string($dbCon, $player3); $player4 = mysqli_real_escape_string($dbCon, $player4); $player5 = mysqli_real_escape_string($dbCon, $player5); $team2 = mysqli_real_escape_string($dbCon, $team2); $player6 = mysqli_real_escape_string($dbCon, $player6); $player7 = mysqli_real_escape_string($dbCon, $player7); $player8 = mysqli_real_escape_string($dbCon, $player8); $player9 = mysqli_real_escape_string($dbCon, $player9); $player10 = mysqli_real_escape_string($dbCon, $player10); $sql = "INSERT INTO `match` (match_name, team1, player1, player2, player3, player4, player5, team2, player6, player7, player8, player9, player10) VALUES ('$team1, '$player1', '$player2', '$player3', '$player4', '$player5', '$team2, '$player6', '$player7', '$player8', '$player9', '$player10')"; if($match_name == "") { echo "You're missing a title for varible <strong>Match Title</strong> | <a href='post.php'>Go back</a>"; return; } if($team1 == "") { echo "You're missing a title for varible <strong>Team 1 Name</strong> | <a href='post.php'>Go back</a>"; return; } if($team2 == "") { echo "You're missing a title for varible <strong>Team 2 Name</strong>"; return; } mysqli_query($dbCon, $sql); header("Location: index.php"); } ?>

PHP Not uploading submitted data to the db

read more

PHP Not uploading submitted data to the db

I’m fairly sure I’ve only made a simple mistake, yet I am having troubles finding it. Basically, whenever someone fills in a normal form, the data they enter is submitted to the db table, to be later posted on another page of the site. However, that does not seem to be working.

If possible, I’d just like some help in the right direction about what I’ve actually done wrong.

Thanks in advance, I hope this post isn’t too annoying. I’m new here :,)

PHP:

<?php session_start(); include_once("connection.php"); if(isset($_POST['post'])) { $match_name = strip_tags($_POST['match_name']); $team1 = strip_tags($_POST['team1']); $player1 = strip_tags($_POST['player1']); $player2 = strip_tags($_POST['player2']); $player3 = strip_tags($_POST['player3']); $player4 = strip_tags($_POST['player4']); $player5 = strip_tags($_POST['player5']); $team2 = strip_tags($_POST['team2']); $player6 = strip_tags($_POST['player6']); $player7 = strip_tags($_POST['player7']); $player8 = strip_tags($_POST['player8']); $player9 = strip_tags($_POST['player9']); $player10 = strip_tags($_POST['player10']); $match_name = mysqli_real_escape_string($dbCon, $match_name); $team1 = mysqli_real_escape_string($dbCon, $team1); $player1 = mysqli_real_escape_string($dbCon, $player1); $player2 = mysqli_real_escape_string($dbCon, $player2); $player3 = mysqli_real_escape_string($dbCon, $player3); $player4 = mysqli_real_escape_string($dbCon, $player4); $player5 = mysqli_real_escape_string($dbCon, $player5); $team2 = mysqli_real_escape_string($dbCon, $team2); $player6 = mysqli_real_escape_string($dbCon, $player6); $player7 = mysqli_real_escape_string($dbCon, $player7); $player8 = mysqli_real_escape_string($dbCon, $player8); $player9 = mysqli_real_escape_string($dbCon, $player9); $player10 = mysqli_real_escape_string($dbCon, $player10); $sql = "INSERT INTO `match` (match_name, team1, player1, player2, player3, player4, player5, team2, player6, player7, player8, player9, player10) VALUES ('$team1, '$player1', '$player2', '$player3', '$player4', '$player5', '$team2, '$player6', '$player7', '$player8', '$player9', '$player10')"; if($match_name == "") { echo "You're missing a title for varible <strong>Match Title</strong> | <a href='post.php'>Go back</a>"; return; } if($team1 == "") { echo "You're missing a title for varible <strong>Team 1 Name</strong> | <a href='post.php'>Go back</a>"; return; } if($team2 == "") { echo "You're missing a title for varible <strong>Team 2 Name</strong>"; return; } mysqli_query($dbCon, $sql); header("Location: index.php"); } ?>

PHP Not uploading submitted data to the db

read more

Yelp hands over user info in jewelry store defamation case [Updated]

(credit: Pageo Jewelers)

Yelp has handed over account information for a previously anonymous account, named “Linda G,” to a Massachusetts jeweler seeking to sue the user.

The company was ordered by a municipal court judge to hand over the user’s name and address after Boston-based Pageo Jewelry provided documentation to Yelp and to the court indicating that the user’s review may be false.

Public Citizen’s Paul Levy, who had taken the case on Yelp’s behalf, told Ars Technica that after seeing Pageo’s documentation at a hearing, he’s off the case. A Yelp spokesperson said that the company has complied with the court’s order.

read more