简体   繁体   English

如何在另一个html页面中呈现html部分?

[英]How to render a html partial in another html page?

I need to render a simple HTML page as partial within this div.It is a simple HTML5 application, not of MVC architecture hence Html.RenderPartial is not working.Any help?? 我需要在这个div中呈现一个简单的HTML页面部分。它是一个简单的HTML5应用程序,而不是MVC架构,因此Html.RenderPartial不工作。任何帮助?

<div id= "this_div_will_contain_partial">
</div>

Use jquery's load: 使用jquery的加载:

<script>
    $(function(){
        $('#this_div_will_contain_partial').load('http://www.urpartialurl.com');
    });
</script>

I have noticed that you haven't included javascript tag but this is the only option to achieve this. 我注意到你没有包含javascript标签,但这是实现这一目标的唯一选择。 Also the page you are trying to access needs to be on the same domain. 您尝试访问的页面也需要位于同一个域中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM