简体   繁体   English

在ie6中查看更新的HTML

[英]Viewing the updated HTML in ie6

I am working with ie6 (unfortunately) and i am having a javascript error. 我正在使用ie6(不幸的是),并且遇到了JavaScript错误。 Its wondrous error message gives me a line in the html source, but unfortunately the javascript that does run changes the code for the page(dramatically). 它的奇妙错误消息在html源代码中给了我一行,但是不幸的是,运行的javascript改变了页面的代码(严重地)。 So the error that its pointing me to is a closing div tag, not actual code. 因此,它指向我的错误是结束div标签,而不是实际的代码。

Is there a way to view the updated code for the page so I can at least know where my code is breaking? 有没有办法查看页面的更新代码,以便至少可以知道我的代码在哪里中断?

I should also point out what im developing in. 我还应该指出即时消息正在发展中。

I am developing a sharepoint 2007 solution for an winxp and ie6 user base. 我正在为winxp和ie6用户群开发一个sharepoint 2007解决方案。 I am working via remote desktop on a sandbox winserver 2008 r2 and can access the site from my terminal. 我正在通过沙盒winserver 2008 r2上的远程桌面进行工作,可以从终端访问该站点。 Now, unfortunately in my sandbox server i have ie 8 in which my code works. 现在,不幸的是,在我的沙箱服务器中,我的代码可以在IE 8中运行。 So im stuck on ideas. 所以我坚持想法。 If anyone knows how to view the updated source on the page, i would be very grateful. 如果有人知道如何在页面上查看更新的源,我将不胜感激。

Thanks. 谢谢。

Edit. 编辑。 I should also mention i dont have admin access on my terminal. 我还应该提到我在终端上没有管理员权限。 So i cant install visual studio. 所以我不能安装Visual Studio。 It would take a couple weeks for an issue ticket for temp admin access to install it, and this is sort of important. 临时管理员访问需要花费几周的时间来安装它,这很重要。

If you can't install anything and the error console information isn't meaningful, then about all you can do is start modifying your code until you can find which section is causing the error. 如果您什么都无法安装,并且错误控制台信息没有意义,那么您几乎可以做的就是开始修改代码,直到找到导致错误的部分为止。 The kinds of modifications you can do are as follows: 您可以进行的修改如下:

  1. Comment out a chunk of code in a way that won't cause more errors. 以不会引起更多错误的方式注释掉一段代码。 If the error goes away, then you know it's in that block of code or something that code calls. 如果错误消失了,那么您就知道它在该代码块中或在代码调用中。 Put that block back in and then comment out a piece of it and so on until you narrow down where the problem is. 放回该块,然后注释掉其中的一块,依此类推,直到缩小问题所在。
  2. Start inserting alert("1"), alert("2") prompts into your code with the goal of identifying which alert the error comes before and after until you've eventually tracked down where it is. 开始插入alert(“ 1”),alert(“ 2”)提示到您的代码中,目的是识别错误发生前后的警报,直到您最终找到错误所在。 When you rule out an area, remove the alerts to make it feasible to still run the app. 当您排除某个区域时,请删除警报以使其仍然可以运行该应用程序。
  3. On a more modern computer (eg Vista/Win7) go to Microsoft's site and download both Microsoft Virtual PC and the Windows image for XP with IE6. 在更现代的计算机(例如Vista / Win7)上,转到Microsoft的站点并下载Microsoft Virtual PC和Windows XP的IE6映像。 You can then actually install things into the VM and do real IE6 debugging or at least see what the actual error is. 然后,您可以将东西实际安装到VM中并进行真正的IE6调试,或者至少查看实际错误是什么。
  4. Find a computer with XP/IE6 on it that you can install real debugging tools on. 查找装有XP / IE6的计算机,可以在其中安装真正的调试工具。
  5. Build your own dummy little debug window using a textarea and a couple functions that append text to it. 使用textarea和几个向其附加文本的函数来构建自己的虚拟小调试窗口。 Put that into your browser page and start sprinkling mydebug("Entering function foo") statements throughout your code so you can narrow down which statements occur before and after the error and eventually find the error. 将其放入浏览器页面,并开始在整个代码中散布mydebug(“ Entering function foo”)语句,以便您可以缩小在错误之前和之后出现的语句的范围,并最终找到错误。 This is how I've done some IE6 debugging when it was't worth the trouble of setting up a full-blown debug environment for IE6. 当不值得为IE6设置成熟的调试环境时,这就是我进行IE6调试的方式。 This works much better than alerts for some types of problems because it doesn't interrupt the flow of the app or require lots of user intervention and you can scroll back through the history. 对于某些类型的问题,这比警报更好,因为它不会中断应用程序的流程或需要大量用户的干预,并且您可以回滚历史记录。

If you are using visual studio you can use it to debug js errors in ie. 如果您使用的是Visual Studio,则可以使用它来调试ie中的js错误。

Go to the Advanced Internet settings in ie and make sure that the two 转到ie中的“ Advanced Internet settings ,并确保两个

Disable script debugging settings are turned off (so that script debugging is enabled) Disable script debugging设置已关闭(以便启用脚本调试)

and that the setting 而且那个设置

display a notification on every script error is enabled. display a notification on every script error启用时display a notification on every script error

If you don't have visual studio installed you can download and install microsofts script debugger (it's free just google it) and use that, tho it is not as easy to work with and won't give you as much useful information 如果您没有安装Visual Studio,则可以下载并安装Microsoft的脚本调试器(仅在Google上免费)并使用它,这样操作起来就不那么容易,并且不会为您提供太多有用的信息

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

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