How do I feed string variable holding multiline value in it to jquery method like prepend? I need it to construct a form pass by drupal search module like - $('#divsearch').prepend('<?php print $search_box; ?>').
Thanks a bunch.
将多行字符串值提供给jquery方法
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
2条回答
- duanmei1946 2010-10-27 13:00关注
I think the problem is that you can have carriage returns or new lines in you string lets take out the php and show what i mean
$('#divsearch').prepend('<div />');
this would work
$('#divsearch').prepend('<div>some text that goes in a div</div>');
this does not work
$('#divsearch').prepend('<div>some text that goes'+ 'in a div</div>');
this woould
解决 无用评论 打赏 举报