views:

38

answers:

1

Hello, 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 =1284615828481">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

A: 

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.

murdoch