2013-10-27 2 views
0

다음은 내가은 자바 스크립트 기능에

Page.ClientScript.RegisterStartupScript(this.GetType(), "onload", "HighlightWord(abc)", true); 

경고 표시 '정의되지 않은'코드 아래 사용하여 위의 함수에 값을 전달할 때 내 자바 스크립트 기능

function HighlightWord(highlightword) { 
     alert(highlightword); 
} 

이다 패스 값 코드에서 뒤에. 이게 뭐가 잘못 되었 니? 감사.

답변

2
Page.ClientScript.RegisterStartupScript(this.GetType(), "onload", "HighlightWord(abc)", true); 

은 사용자가 가지고 있지 않은 것으로 가정하는 변수 인 abc을 경고합니다. 그것은이어야합니다

Page.ClientScript.RegisterStartupScript(this.GetType(), "onload", "HighlightWord('abc')", true);`. 

이것은 "abc"라고 생각합니다.

관련 문제