谁还没个明天 2010-09-16 06:06 采纳率: 50%
浏览 66

Firefox重新加载JavaScript

I am a beginner web developer and here is my problem:

In short:

I keep getting similar message in Firebug for all the javascripts I include in the page:

GET http://localhost.:33085/Scripts/jquery.form.js?_=1284615828481 200 OK 1.01s

In details:

I am loading a webpage using AJAX . This page contains references to some java scripts. It also contains some embedded javascript code. Firefox keeps reloading the referenced java scripts each time I navigate to these pages which seems to take time. My questions are:

  1. These scripts are already referenced in the page that has the where I load this page using AJAX. if I remove the references from this ajax loaded page, I start getting '$ is not defined'. Is there away to avoid that error other than referencing these scripts in the AJAX loaded page?

  2. How can I stop firefox from reloading those pages and start using cached version?

  3. Why is it so slow on firefox? I don't seem to see such perf issues on IE or Chrome?

Thanks

  • 写回答

1条回答 默认 最新

  • weixin_33749242 2010-09-16 06:23
    关注

    The best approach is to ensure that the initial page that you first access loads the required scripts and then subsequent ajax requests only load the content that you need (i.e. the references to the scripts is not in the html returned by the ajax request). There are server side frameworks to help you achieve this but without knowing your server technology I cant recommend a specific solution.

    Firefox may be slow due to Firebug, with full debugging enabled in firebug it can slow you web pages down.

    评论

报告相同问题?

悬赏问题

  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题