在Ruby中,您可以像这样使用字符串插值:
这样可以避免显式连接的需要。
我正在使用jQuery,有一个类似于这样的代码:
我希望的行为是“点击
text = "This is visit number #{numVisits} to this website"
这样可以避免显式连接的需要。
我正在使用jQuery,有一个类似于这样的代码:
$(document).ready(function(){
$("a.ajax").click(function(event){
$("#content").load("data.html this.getClass");
});
});
我希望的行为是“点击
<a class="ajax" id="schedule"></a>
,当前页面的content
div
将被data.html
中的schedule
div
替换。如果我手动编写。load("data.html #test");
这个可以运行,但我希望脚本可以加载与所点击锚点ID值相对应的DIV。任何帮助都将不胜感激!
load
方法? - Gumbo