Triple Quotes? How do I delimit a databound Javascript string parameter in ASP.NET?

How do I delimit a Javascript data-bound string parameter in an anchor `OnClick` event? - I have an anchor tag in an ASP.NET Repeater control. - The `OnClick` event of the anchor contains a call to a Javascript function. - The Javascript function takes a string for its input parameter. - The string parameter is populated with a data-bound value from the Repeater. I need the "double quotes" for the `Container.DataItem`. I need the 'single quotes' for the `OnClick`. And I still need *one more delimiter* (triple quotes?) for the input string parameter of the Javascript function call. Since I can't use 'single quotes' again, how do I ensure the Javascript function knows the input parameter is a string and not an integer? Without the extra quotes around the input string parameter, the Javascript function thinks I'm passing in an integer. The anchor: Show/Hide and here is the Javascript:

以上就是Triple Quotes? How do I delimit a databound Javascript string parameter in ASP.NET?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏