【发布时间】:2013-07-22 20:53:33
【问题描述】:
[尝试 1]
<script>
var example = $.get("example.html");
document.writeln(example);
</script>
我希望将源文件嵌入为原始文本(不是标记)。这甚至没有接近工作。
感谢大家迄今为止的帮助和意见!
[尝试 2/3]@JasonP
...
<script>
$(document).ready(function () {
$.get("example.html").done(function (result) {
$('#SomeElement').text(result);
});
});
</script>
...
<a id="SomeElement" />
...
不过,在尝试 3 时,我仍然没有从中得到任何东西。不过,我理解“准备好了”。
【问题讨论】:
-
name应该是id -
我更新了我的答案。当您编辑问题时,发布答案的人不会自动收到通知,因此请务必评论他们的答案或直接向他们发表评论,如下所示:“@JasonP 嘿,看看我!”