在阅读HTML文件,JavaScript变量(视窗) [英] reading html file to javascript variable (windows)

查看:128
本文介绍了在阅读HTML文件,JavaScript变量(视窗)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哎, 我想读一个HTML文件到将包含一个字符串一个javascript变量。 有一个适当的功能,例如,需要将文件路径作为一个参数。

hey, I want to read an html file into a javascript variable that will contain it as a string. is there an appropriate function, for example, that takes the file path as a parameter.

感谢

推荐答案

虽然 XMLHtt prequest 可用来下载整个网页,它通常用于下载小块的数据,可用于更新当前页面。

Although XMLHttpRequest can be used to download entire pages, it is often used for downloading small pieces of data that can be used to update the current page.

下面是它的基础: XMLHtt prequest

这应该可以帮助你跳开始我就希望。

This should help you jump start i hope.

这篇关于在阅读HTML文件,JavaScript变量(视窗)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆