获取页面源代码 [英] Obtain page sourceCode
本文介绍了获取页面源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个页面,其中包含XSL作为其源代码.有什么方法可以获取页面源代码(如右键单击->在IE中显示源代码所示)?
I have a page wich contains a XSL as it's source code. Is there any way to get the page source code (as seen on right-click->show source code in IE)?
页面源代码是XSL!我需要将其存储在变量中以供以后使用.
The page source code IS a XSL! I need to store it in a variable to use later.
推荐答案
乍一看,XML源似乎在转换过程中不可避免地丢失了.我能想到的最简单的方法是再次使用AJAX查询页面. (在大多数浏览器中,由于缓存,这应该非常快.)
At first glance, the XML source seems to be irremediably lost in the transformation process. The simplest way I can think of is to use AJAX to query the page again. (On most browsers, this should be very fast because of caching.)
$.get(document.location, function(xml) { /* do something with xml */});
这篇关于获取页面源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文