The main line of the Northern Pacific Railway passes in a general easterly and westerly direction through the corporate limits of the city of Ole Elum, in this state; the company also maintains yards within the same corporate limits, approximately one and one-half miles in length. For a space of practically a mile, there is a large amount of trackage paralleling the main track—sixteen par*217allel tracks, to be exact. These tracks are numbered, the two northernmost tracks being numbers fifteen and sixteen. In this entire area, there is but one public crossing. Contiguous to the yard trackage are dwellings and a schoolhouse, and adjacent to certain parts thereof is dense undergrowth. It appears that the public have for years crossed the tracks at any point suited to individual convenience, there being no fence or other obstruction to such passage. Paths had been worn leading to the railway grade, but there were no defined paths across the grade and the tracks themselves.
On June 23, 1917, in the afternoon, John Lievore, a boy nine years of age, came upon a path from the north of the tracks, with a companion of about the same age, while cars to which an engine was attached were standing on "track number fifteen. He walked along track sixteen for a short distance, and then leaving his companion, crossed to track fifteen and proceeded to get upon one of the cars there standing, grasping the handirons on the side of the car, and was attempting to place his feet in the iron stirrup, when the train started. The jerk threw bim from the car, whereby he sustained injuries, the subject of this suit.
At the trial in the superior court for King county, the appellant predicated his case upon the theory that, conceding’ the boy to be a trespasser, nevertheless the company was so negligent as to render it liable in damages. The negligence consisted, it was there urged, and is here argued, of two phases: first, that the trainmen in charge of the train from which the boy was thrown were not, or should not have been, ignorant of the boy’s attempt to board the car; and second, the failure of the company to maintain a fence on that portion of its right of way. To this the respondent replies that it was not the duty of the train*218men, in these circumstances, to keep watch for trespassing children, and that the absence of a fence upon the right of way was at the order of the city authorities of Cle Blum, averring that it is, and has always been, ready and willing to erect an adequate fence thereon.
There is considerable evidence in the record as to the trespassing of children on the company’s tracks. It will be conceded that the gist of this evidence is that it was well known to the authorities of the city of Cle Blum and of the railroad company, and that efforts were made from time to time, by way of warning and some arrests, to deter this form of trespassing. The appellant contends that this situation presented a question as to how much the duty of a railroad crew towards trespassing children was qualified by such situation, arguing that ft placed upon the crews the burden of determining, before starting their trains, whether or not any children were boarding them or had boarded them. There is no testimony that the crew saw the boy, the obligation sought to be enjoined upon the respondent being that its crew should have seen him. In other words, there was no wanton injury. The company was not obliged to employ men to keep boys from trying to ride on the cars:
“As wide a range as the decisions of courts have taken on this interesting subject, no court, to my knowledge, has gone so far as to hold that railroad companies are the absolute insurers of the life and limbs of boys who, against their express commands, insist upon trespassing upon their property; and to sustain this case would, in my opinion, go that fár. The only way the company could prevent this would be to keep a sufficient number of guards to detect boys in their attempts to board the cars or engines. If the presence of the boy on the engine or cars had been brought to the knowledge of the operators of the en*219gine, it is plain that their duty would have been to have protected him from harm, no matter how great his negligence might have been. The testimony shows that they did not see the boy on the engine, and did not know that he was there; for, by reason of his location on the foot-hoard of the engine, the engineer, in the performance of his ordinary duties, could not have seen him.” Oregon R. & Nav. Co. v. Egley, 2 Wash. 409, 26 Pac. 973, 26 Am. St. 860.
See, also, Clark v. Northern Pac. R. Co., 29 Wash. 139, 69 Pac. 636, 59 L. R. A. 508; Johnson v. Great Northern R. Co., 49 Wash. 98, 94 Pac. 895; Kroeger v. Grays Harbor Construction Co., 83 Wash. 68, 145 Pac. 63; Shafer v. Tacoma Eastern R. Co., 91 Wash. 164, 157 Pac. 485, L. R. A. 1916F 114; 2 Thompson, Negligence, § 1825; 2 White, Personal Injury on Railroads, § 1102. The crew was performing its duty and in proper positions where its members could not see the hoy coming upon the right of way, and had, therefore, no opportunity, to anticipate that he was about to- attempt to climb onto the cars. The train was being properly handled, and the respondent cannot be held to the duty of operating it for the convenience of the hoy, who was there only for the purpose of trespassing upon the cars. On this phase of the case, the respondent was clearly not liable.
In 1906, the city of Cle Elum passed an ordinance providing for the fencing by the respondent of its right of way, and the appellant-calls attention to the general rule that the violation of such an ordinance is in itself negligence. Without passing upon the question presented by the respondent’s evidence tending to show that the operation of the ordinance had been suspended at the order o-f the city, we are of the opinion that the receiving of the ordinance in evidence and permitting the introduction of testimony in regard to the nonfencing of the right of way was erroneous. *220Where facts constituting the alleged negligence are specifically set forth in the complaint, it is error to allow on the trial evidence of other acts of negligence, when the admission of such evidence has been properly objected to. The complaint in this case charged the railroad company with failing to warn or object to children playing and loitering upon its right of way, and that the employees of the company, seeing the boy standing on the siding track, and seeing him take hold of the car for the purpose of boarding it, started the train suddenly without notice. These grounds of negligence, as alleged, do not present the question of the fencing of the right of way, and lay no foundation for the introduction of evidence of the ordinance providing for the fencing. The necessity of alleging the grounds upon which recovery is to be obtained is well illustrated in this case; the action was tried in a county different from that in which is the city whose ordinance is in question, and presents an issue which, on that account, was difficult to meet, and which might have been met had notice been given the opposing party of the tender of the issue by its being pleaded in the complaint. In this case, the record shows that there was a serious question whether the ordinance was in effect at the .time of the injury. In view of those facts, it was certainly prejudicial to the respondent to have introduced, over its objection, issues which were not pleaded.
There being no evidence in the case sufficient to go to the jury upon the first question discussed, and the evidence in regard to the fencing of the track having been improperly admitted, the appellant was not entitled to recover, and the judgment of the lower court will be affirmed.
Chadwick, C. J., Mitchell, Main, and Tolman, JJ., concur.